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>
Holder for OSGI service. Implemented using
ServiceTracker
.- Author:
- hengsin
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet service with highest service.ranking valueGet service reference for service with highest service.ranking valueGet list of service reference, sorted by service.ranking (from highest to lowest ranking).Get list of service, sorted by service.ranking (from highest to lowest ranking)
-
Constructor Details
-
DynamicServiceHolder
- Parameters:
tracker
-
-
-
Method Details
-
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
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
Description copied from interface:IServiceHolder
Get service reference for service with highest service.ranking value- Specified by:
getServiceReference
in interfaceIServiceHolder<T>
- Returns:
IServiceReferenceHolder
-
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
-