Package org.apache.felix.cm.impl.helper
Class ManagedServiceFactoryTracker
java.lang.Object
org.osgi.util.tracker.ServiceTracker<org.osgi.service.cm.ManagedServiceFactory,ConfigurationMap<?>>
org.apache.felix.cm.impl.helper.BaseTracker<org.osgi.service.cm.ManagedServiceFactory>
org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker
- All Implemented Interfaces:
org.osgi.util.tracker.ServiceTrackerCustomizer<org.osgi.service.cm.ManagedServiceFactory,ConfigurationMap<?>>
public class ManagedServiceFactoryTracker
extends BaseTracker<org.osgi.service.cm.ManagedServiceFactory>
-
Field Summary
Fields inherited from class org.apache.felix.cm.impl.helper.BaseTracker
cmFields inherited from class org.osgi.util.tracker.ServiceTracker
context, filter -
Constructor Summary
ConstructorsConstructorDescriptionManagedServiceFactoryTracker(org.apache.felix.cm.impl.ConfigurationManager cm) -
Method Summary
Modifier and TypeMethodDescriptionprotected ConfigurationMap<?> createConfigurationMap(String[] pids) getServicePid(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> service, TargetedPID pid) Always returns the raw PID because for a ManagedServiceFactory the configuration's PID is automatically generated and is not a real targeted PID.voidprovideConfiguration(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> reference, TargetedPID configPid, TargetedPID factoryPid, Dictionary<String, ?> properties, long revision, ConfigurationMap<?> configs) Updates the given service with the provided configuration.voidremoveConfiguration(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> reference, TargetedPID configPid, TargetedPID factoryPid) Remove the configuration indicated by theconfigPidfrom the service.Methods inherited from class org.apache.felix.cm.impl.helper.BaseTracker
addingService, getAccessControlContext, getProperties, getRealService, getServices, handleCallBackError, modifiedService, removedService, ungetRealServiceMethods inherited from class org.osgi.util.tracker.ServiceTracker
close, getService, getService, getServiceReference, getServiceReferences, getServices, getServices, getTracked, getTrackingCount, isEmpty, open, open, remove, size, waitForService
-
Constructor Details
-
ManagedServiceFactoryTracker
public ManagedServiceFactoryTracker(org.apache.felix.cm.impl.ConfigurationManager cm)
-
-
Method Details
-
createConfigurationMap
- Specified by:
createConfigurationMapin classBaseTracker<org.osgi.service.cm.ManagedServiceFactory>
-
getServicePid
public String getServicePid(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> service, TargetedPID pid) Always returns the raw PID because for a ManagedServiceFactory the configuration's PID is automatically generated and is not a real targeted PID.- Specified by:
getServicePidin classBaseTracker<org.osgi.service.cm.ManagedServiceFactory>- Parameters:
service- The reference ot the service for which the service PID is to be returned.pid- TheTargetedPIDfor which to return the service PID.- Returns:
- The service PID or
nullif the service does not respond to the targeted PID at all.
-
provideConfiguration
public void provideConfiguration(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> reference, TargetedPID configPid, TargetedPID factoryPid, Dictionary<String, ?> properties, long revision, ConfigurationMap<?> configs) Description copied from class:BaseTrackerUpdates the given service with the provided configuration.See the implementations of this method for more information.
- Specified by:
provideConfigurationin classBaseTracker<org.osgi.service.cm.ManagedServiceFactory>- Parameters:
reference- The reference to the service to updateconfigPid- The targeted configuration PIDfactoryPid- The targeted factory PID ornullfor a non-factory configurationproperties- The configuration properties, which may benullif this is the provisioning call upon service registration of a ManagedServicerevision- The configuration revision or -1 if there is no configuration actually to provide.configs- The PID to configuration map for PIDs used by the service to update- See Also:
-
removeConfiguration
public void removeConfiguration(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> reference, TargetedPID configPid, TargetedPID factoryPid) Description copied from class:BaseTrackerRemove the configuration indicated by theconfigPidfrom the service.- Specified by:
removeConfigurationin classBaseTracker<org.osgi.service.cm.ManagedServiceFactory>- Parameters:
reference- The reference to the service from which the configuration is to be removed.configPid- TheTargetedPIDof the configurationfactoryPid- Thefactory PIDof the configuration. This may benullfor a non-factory configuration.
-