Package org.adempiere.base.ds
Class DynamicServiceHolder<T>
- java.lang.Object
-
- org.adempiere.base.ds.DynamicServiceHolder<T>
-
- All Implemented Interfaces:
IServiceHolder<T>
,IServicesHolder<T>
public class DynamicServiceHolder<T> extends Object implements IServiceHolder<T>, IServicesHolder<T>
- Author:
- hengsin
-
-
Constructor Summary
Constructors Constructor Description DynamicServiceHolder(org.osgi.util.tracker.ServiceTracker<T,T> tracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getService()
Get service with highest service.ranking valueIServiceReferenceHolder<T>
getServiceReference()
Get service reference for service with highest service.ranking valueList<IServiceReferenceHolder<T>>
getServiceReferences()
Get list of service reference, sorted by service.ranking (from highest to lowest ranking).List<T>
getServices()
Get list of service, sorted by service.ranking (from highest to lowest ranking)
-
-
-
Method Detail
-
getService
public T getService()
Description copied from interface:IServiceHolder
Get service with highest service.ranking value- Specified by:
getService
in interfaceIServiceHolder<T>
- Returns:
- service instance. null if not available or no matching service found
-
getServices
public List<T> getServices()
Description copied from interface:IServicesHolder
Get list of service, sorted by service.ranking (from highest to lowest ranking)- Specified by:
getServices
in interfaceIServicesHolder<T>
- Returns:
- list of service instance. null if not available or no matching service found
-
getServiceReference
public IServiceReferenceHolder<T> getServiceReference()
Description copied from interface:IServiceHolder
Get service reference for service with highest service.ranking value- Specified by:
getServiceReference
in interfaceIServiceHolder<T>
- Returns:
IServiceReferenceHolder
-
getServiceReferences
public List<IServiceReferenceHolder<T>> getServiceReferences()
Description copied from interface:IServicesHolder
Get list of service reference, sorted by service.ranking (from highest to lowest ranking). If you want to cache service, cache IServiceReferenceHolder instead of the actual service object- Specified by:
getServiceReferences
in interfaceIServicesHolder<T>
- Returns:
- list of
IServiceReferenceHolder
-
-