|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.qi4j.spi.service.importer.ServiceSelectorImporter<T>
public final class ServiceSelectorImporter<T>
If several services are available with a given type, and you want to constrain the current module to use a specific one, then use this importer. Specify a Specification<ServiceReference<T>> criteria as meta-info for the service, which will be applied to the list of available services, and the first match will be chosen. This importer will avoid selecting itself, as could be possible if the ServiceQualifier.first() filter is used.
Constructor Summary | |
---|---|
ServiceSelectorImporter()
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceSelectorImporter()
Method Detail |
---|
public T importService(ImportedServiceDescriptor serviceDescriptor) throws ServiceImporterException
ServiceImporter
importService
in interface ServiceImporter<T>
serviceDescriptor
- The service descriptor.
ServiceImporterException
- if import failed.public boolean isActive(T instance)
ServiceImporter
isActive
in interface ServiceImporter<T>
instance
- the instance to be checked
public boolean isAvailable(T instance)
ServiceImporter
isAvailable
in interface ServiceImporter<T>
instance
- the instance to be checked
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |