Interface ComponentHolder<S>
- All Known Implementing Classes:
ComponentRegistry.DefaultConfigurableComponentHolder, ConfigurableComponentHolder
public interface ComponentHolder<S>
The
ComponentHolder interface provides the API for supporting
component instances configured through either singleton configurations (or
no configuration at all) and factory configurations.
Instances of this interface are managed by the RegionConfigurationSupport
class on behalf of the
BundleComponentActivator and the
ComponentRegistry.
-
Method Summary
Modifier and TypeMethodDescriptionvoidconfigurationDeleted(TargetedPID pid, TargetedPID factoryPid) The configuration with the given PID has been deleted from the Configuration Admin service.booleanconfigurationUpdated(TargetedPID targetedPid, TargetedPID factoryTargetedPid, Dictionary<String, Object> props, long changeCount) Configure a component with configuration from the given PID.org.osgi.util.promise.Promise<Void> disableComponents(boolean async) Disables all components of this holder.voiddisposeComponents(int reason) Disposes off all components of this holder.org.osgi.util.promise.Promise<Void> enableComponents(boolean async) Enables all components of this holder and if satisfied activates them.Returns theComponentActivatorowning this component holder.Returns theComponentMetadatadescribing and declaring this component.List<? extends ComponentManager<?>> Returns allComponentinstances held by this holder.getConfigurationTargetedPID(TargetedPID pid, TargetedPID factoryPid) Returns the targeted PID used to configure this componentbooleanwhether the component is currently enabled
-
Method Details
-
getActivator
ComponentActivator getActivator()Returns theComponentActivatorowning this component holder. (overlaps ComponentContaienr) -
getComponentMetadata
ComponentMetadata getComponentMetadata()Returns theComponentMetadatadescribing and declaring this component. (overlaps ComponentContaienr) -
configurationDeleted
The configuration with the given PID has been deleted from the Configuration Admin service.- Parameters:
pid- The PID of the deleted configurationfactoryPid- The factory PID of the deleted configuration
-
configurationUpdated
boolean configurationUpdated(TargetedPID targetedPid, TargetedPID factoryTargetedPid, Dictionary<String, Object> props, long changeCount) Configure a component with configuration from the given PID.- Parameters:
targetedPid- Targeted PID for the configurationfactoryTargetedPid- the (targeted) factory pid or null for a singleton pidprops- the property dictionary from the configuration.changeCount- change count of the configuration, or R4 imitation.- Returns:
- true if a new component is created for a factory PID, false if an existing factory pid configuration is updated or we have no factory pid
-
getConfigurationTargetedPID
Returns the targeted PID used to configure this component- Parameters:
pid- a targetedPID containing the service pid for the component desired (the rest of the targeted pid is ignored)factoryPid- a targetedPID containing the factory pid for the component desired.- Returns:
- the complete targeted pid actually used to configure the comonent.
-
getComponents
List<? extends ComponentManager<?>> getComponents()Returns allComponentinstances held by this holder. -
enableComponents
Enables all components of this holder and if satisfied activates them.- Parameters:
async- Whether the actual activation should take place asynchronously or not.
-
disableComponents
Disables all components of this holder.- Parameters:
async- Whether the actual deactivation should take place asynchronously or not.
-
isEnabled
boolean isEnabled()whether the component is currently enabled- Returns:
- whether the component is enabled
-
disposeComponents
void disposeComponents(int reason) Disposes off all components of this holder.- Parameters:
reason-
-