Interface IManagedService


  • public interface IManagedService
    An abstraction that represents a managed service that is intended to be activated and deactivated by some container.

    Clients may use this interface implementations with the InjectorAwareServiceRegistrator or ServiceRegistrator services registration container. Note, that these containers are intended to activate and deactivate only singletons managed service implementations.

    See Also:
    ServiceRegistrator, InjectorAwareServiceRegistrator
    • Method Detail

      • activate

        void activate()
        Activates this instance. This causes the instance of IManagedService to perform all neccessary initialization.

        Activation of managed services should not take a long time. Long-running work should be scheduled and performed asynchronously.

        Managed services container calls this method when it starts.

      • deactivate

        void deactivate()
        Deactivaes this instance. This causes the instance of IManagedService to cleanup any resources that it maintains and perform all neccessary deinitialization.

        Managed services container calls this method when it stops.