org.qi4j.api.service
Interface ServiceImporter<T>

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

public interface ServiceImporter<T>

Import a service from some external source.


Method Summary
 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