org.apache.felix.cm.impl.helper
Class ManagedServiceFactoryTracker
java.lang.Object
org.osgi.util.tracker.ServiceTracker<S,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>
| Fields inherited from class org.apache.felix.cm.impl.helper.BaseTracker |
cm |
| Fields inherited from class org.osgi.util.tracker.ServiceTracker |
context, filter |
|
Method Summary |
protected ConfigurationMap<?> |
createConfigurationMap(java.lang.String[] pids)
|
java.lang.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. |
void |
provideConfiguration(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> reference,
TargetedPID configPid,
TargetedPID factoryPid,
java.util.Dictionary<java.lang.String,?> properties,
long revision,
ConfigurationMap<?> configs)
Updates the given service with the provided configuration. |
void |
removeConfiguration(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> reference,
TargetedPID configPid,
TargetedPID factoryPid)
Remove the configuration indicated by the configPid from
the service. |
| Methods inherited from class org.osgi.util.tracker.ServiceTracker |
close, getService, getService, getServiceReference, getServiceReferences, getServices, getServices, getTracked, getTrackingCount, isEmpty, open, open, remove, size, waitForService |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ManagedServiceFactoryTracker
public ManagedServiceFactoryTracker(ConfigurationManager cm)
createConfigurationMap
protected ConfigurationMap<?> createConfigurationMap(java.lang.String[] pids)
- Specified by:
createConfigurationMap in class BaseTracker<org.osgi.service.cm.ManagedServiceFactory>
getServicePid
public java.lang.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:
getServicePid in class BaseTracker<org.osgi.service.cm.ManagedServiceFactory>
- Parameters:
service - The reference ot the service for which the service
PID is to be returned.pid - The TargetedPID for which to return the service
PID.
- Returns:
- The service PID or
null if 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,
java.util.Dictionary<java.lang.String,?> properties,
long revision,
ConfigurationMap<?> configs)
- Description copied from class:
BaseTracker
- Updates the given service with the provided configuration.
See the implementations of this method for more information.
- Specified by:
provideConfiguration in class BaseTracker<org.osgi.service.cm.ManagedServiceFactory>
- Parameters:
reference - The reference to the service to updateconfigPid - The targeted configuration PIDfactoryPid - The targeted factory PID or null for
a non-factory configurationproperties - The configuration properties, which may be
null if 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:
ManagedServiceTracker.provideConfiguration(ServiceReference, TargetedPID, TargetedPID, Dictionary, long, ConfigurationMap),
provideConfiguration(ServiceReference, TargetedPID, TargetedPID, Dictionary, long, ConfigurationMap)
removeConfiguration
public void removeConfiguration(org.osgi.framework.ServiceReference<org.osgi.service.cm.ManagedServiceFactory> reference,
TargetedPID configPid,
TargetedPID factoryPid)
- Description copied from class:
BaseTracker
- Remove the configuration indicated by the
configPid from
the service.
- Specified by:
removeConfiguration in class BaseTracker<org.osgi.service.cm.ManagedServiceFactory>
- Parameters:
reference - The reference to the service from which the
configuration is to be removed.configPid - The TargetedPID of the configurationfactoryPid - The factory PID of the
configuration. This may be null for a non-factory
configuration.
Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.