Class ManagedServicesSupport


  • public class ManagedServicesSupport
    extends Object
    Support for services activation and deactivation.

    Instances of ManagedServicesSupport are not safe for use by multiple threads.

    See Also:
    IManagedService
    • Constructor Detail

      • ManagedServicesSupport

        public ManagedServicesSupport()
    • Method Detail

      • activateManagedService

        public void activateManagedService​(IManagedService service)
        Activate the given managed service.
        Parameters:
        service - the of managed service, cannot be null
        See Also:
        IManagedService
      • activateManagedServices

        public void activateManagedServices​(List<IManagedService> services)
        Activate the given managed services.
        Parameters:
        services - the list of managed services, cannot be null
        See Also:
        IManagedService
      • activateManagedServices

        public void activateManagedServices​(Function<Class<? extends IManagedService>,​IManagedService> classToInstance,
                                            List<Class<? extends IManagedService>> managedServices)
        Activate the given managed services. Service instances will be supplied by the support injector.
        Parameters:
        classToInstance - fuction to get instances of services from its classes, cannot be null
        managedServices - the list of managed service classes, cannot be null
        See Also:
        IManagedService
      • deactivateManagedServices

        public void deactivateManagedServices​(org.eclipse.core.runtime.Plugin plugin)
        Deactivate all previously activated IManagedService services that clients activaed in #activateManagedServices() method.

        Services will be deactivated in reversed order.

        Parameters:
        plugin - the plug-in instance to log errors to, cannot be null
        See Also:
        IManagedService
      • deactivateManagedServices

        public void deactivateManagedServices()
        Deactivate all previously activated IManagedService services that clients activaed in #activateManagedServices() method.

        Services will be deactivated in reversed order.

        See Also:
        IManagedService