Interface LifecyclePolicy


@Contract public interface LifecyclePolicy
Modules that wish to invoke special logic when it is loaded, started or stopped should implement this interface.

To define an implementation of this in a module, write a class that implements this interface and puts Service on it. Maven will take care of the rest.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    start(Module module)
    Callback when the module enters the READY state.
    void
    stop(Module module)
    Callback before the module starts being unloaded.
  • Method Details

    • start

      void start(Module module)
      Callback when the module enters the READY state. This is a good time to do any type of one time initialization or set up access to resources
      Parameters:
      module - the module instance
    • stop

      void stop(Module module)
      Callback before the module starts being unloaded. The runtime will free all the module resources and returned to a NEW state.
      Parameters:
      module - the module instance