org.qi4j.api.service

## Interface ServiceImporter<T>

- All Known Subinterfaces:
    DBCPDataSourceServiceImporter
  All Known Implementing Classes:
    AbstractDataSourceServiceImporterMixin, BoneCPDataSourceServiceImporter.Mixin, DBCPDataSourceServiceImporter.Mixin, InstanceImporter, MBeanServerImporter, NewObjectImporter, OSGiServiceImporter, ServiceInstanceImporter, ServiceSelectorImporter, SpringImporter

      public interface ServiceImporter<T>

  Import a service from some external source.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `importService(ImportedServiceDescriptor serviceDescriptor)` Imports an instance of the service type described in the service descriptor.
    `boolean` | `isAvailable(T instance)` Ask if the service is available or not.

- - ### Method Detail

    - #### importService

          T importService(ImportedServiceDescriptor serviceDescriptor)
                          throws ServiceImporterException

      Imports an instance of the service type described in the service descriptor.
      Parameters:
        `serviceDescriptor` - The service descriptor.
      Returns:
        The imported service instance.
      Throws:
        `ServiceImporterException` - if import failed.

    - #### isAvailable

          boolean isAvailable(T instance)

      Ask if the service is available or not.
      Parameters:
        `instance` - the instance to be checked
      Returns:
        true if the service is available, false if not