public interface IManagedServiceAn 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
ServiceRegistratorservices registration container. Note, that these containers are intended to activate and deactivate only singletons managed service implementations.
void activate()Activates this instance. This causes the instance of
IManagedServiceto 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.
void deactivate()Deactivaes this instance. This causes the instance of
IManagedServiceto cleanup any resources that it maintains and perform all neccessary deinitialization.
Managed services container calls this method when it stops.