ServiceComponentRuntime service represents the Declarative
Services actor, known as Service Component Runtime (SCR), that manages the
service components and their life cycle. The ServiceComponentRuntime
service allows introspection of the components managed by Service Component
Runtime.
This service differentiates between a ComponentDescriptionDTO and a
ComponentConfigurationDTO. A ComponentDescriptionDTO is a
representation of a declared component description. A
ComponentConfigurationDTO is a representation of an actual instance
of a declared component description parameterized by component properties.
This service must be registered with a Constants#SERVICE_CHANGECOUNT
service property that must be updated each time the SCR DTOs available from
this service change.
Access to this service requires the
ServicePermission[ServiceComponentRuntime, GET] permission. It is
intended that only administrative bundles should be granted this permission
to limit access to the potentially intrusive methods provided by this
service.
| Modifier and Type | Method and Description |
|---|---|
| public Promise | Returns: A promise that will be resolved when the actions that result from changing the enabled state of the specified component have completed. If the provided description does not belong to an active bundle, a failed promise is returned.The component description to disable. Must not be
description)null.Disables the specified component description. |
| public Promise | Returns: A promise that will be resolved when the actions that result from changing the enabled state of the specified component have completed. If the provided description does not belong to an active bundle, a failed promise is returned.The component description to enable. Must not be
description)null.Enables the specified component description. |
| public Collection | Returns: A collection containing a snapshot of the current component configurations for the specified component description. An empty collection is returned if there are none or if the provided component description does not belong to an active bundle.The component description. Must not be description)null.Returns the component configurations for the specified component description. |
| public ComponentDescriptionDTO | Returns: The declared component description ornull if the
specified bundle is not active or does not declare a component
description with the specified name.The bundle declaring the component description. Must not be
bundle, String null.The name of the component description. Must not be
name)null.Returns the |
| public Collection | Returns: The declared component descriptions of the specified activebundles. An empty collection is returned if there are no
component descriptions for the specified active bundles.The bundles whose declared component descriptions are to
be returned. Specifying no bundles, or the equivalent of an empty
bundles)Bundle array, will return the declared component
descriptions from all active bundles.Returns the component descriptions declared by the specified active bundles. |
| public boolean | Returns: true if the specified component description is currently
enabled. Otherwise, false.The component description. Must not be description)null.Returns whether the specified component description is currently enabled. |
| disableComponent | back to summary |
|---|---|
| public Promise Disables the specified component description. If the specified component description is currently disabled, this method has no effect. This method must return after changing the enabled state of the specified component description. Any actions that result from this, such as activating or deactivating a component configuration, must occur asynchronously to this method call.
| |
| enableComponent | back to summary |
|---|---|
| public Promise Enables the specified component description. If the specified component description is currently enabled, this method has no effect. This method must return after changing the enabled state of the specified component description. Any actions that result from this, such as activating or deactivating a component configuration, must occur asynchronously to this method call.
| |
| getComponentConfigurationDTOs | back to summary |
|---|---|
| public Collection Returns the component configurations for the specified component description.
| |
| getComponentDescriptionDTO | back to summary |
|---|---|
| public ComponentDescriptionDTO getComponentDescriptionDTO(Bundle bundle, String name) Returns the
Only component descriptions from active bundles are returned.
| |
| getComponentDescriptionDTOs | back to summary |
|---|---|
| public Collection Returns the component descriptions declared by the specified active bundles. Only component descriptions from active bundles are returned. If the specified bundles have no declared components or are not active, an empty collection is returned.
| |
| isComponentEnabled | back to summary |
|---|---|
| public boolean isComponentEnabled(ComponentDescriptionDTO description) Returns whether the specified component description is currently enabled.
The enabled state of a component description is initially set by the
| |