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

All Known Subinterfaces:
DataSourceService
All Known Implementing Classes:
DataSourceService.Mixin, InstanceImporter, MBeanServerImporter, NewObjectImporter, OSGiServiceImporter, ServiceInstanceImporter, ServiceSelectorImporter, SpringImporter

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 isActive(T instance)
          Ask if the underlying service is currently active or not.
 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.

isActive

boolean isActive(T instance)
Ask if the underlying service is currently active or not.

Parameters:
instance - the instance to be checked
Returns:
true if the service is active, false if not

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