Package org.sonar.api

Interface Startable


  • public interface Startable
    An interface which is implemented by classes annotated with ScannerSide, ServerSide and/or ComputeEngineSide (referred to below as "component") that can be started and stopped.

    The method start() is called at the begin of the component lifecycle. It can be called again only after a call to stop(). The stop() method is called at the end of the component lifecycle, and can further be called after every start().

    In the WebServer, a component is started once: either right when the WebServer is started if there is no migration, otherwise only after Database has been successfully migrated. It is stopped once when the WebServer is shutdown. Any exception thrown by method start() will make the WebServer startup fail.

    In the Compute Engine, a component is started once when the Compute Engine is started and stopped once when the ComputeEngine is shut down. Any exception thrown by method start() will make the Compute Engine startup fail.

    On Scanner side, the lifecycle of a component depends on the value of the InstantiationStrategy annotation.

    • Method Detail

      • start

        void start()
        Start this component. Called initially at the begin of the lifecycle. It can be called again after a stop.
      • stop

        void stop()
        Stop this component. Called near the end of the lifecycle. It can be called again after a further start.