Interface ComponentHolder<S>

  • All Known Implementing Classes:
    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 Detail

      • configurationDeleted

        void configurationDeleted​(TargetedPID pid,
                                  TargetedPID factoryPid)
        The configuration with the given PID has been deleted from the Configuration Admin service.
        Parameters:
        pid - The PID of the deleted configuration
        factoryPid - 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 configuration
        factoryTargetedPid - the (targeted) factory pid or null for a singleton pid
        props - 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

        TargetedPID getConfigurationTargetedPID​(TargetedPID pid,
                                                TargetedPID factoryPid)
        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 all Component instances held by this holder.
      • enableComponents

        org.osgi.util.promise.Promise<Void> enableComponents​(boolean async)
        Enables all components of this holder and if satisfied activates them.
        Parameters:
        async - Whether the actual activation should take place asynchronously or not.
      • disableComponents

        org.osgi.util.promise.Promise<Void> disableComponents​(boolean async)
        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 -