Interface ServiceController

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getServiceName()
      Returns the name of this service.
      boolean isActive()
      Returns whether this service is currently started and active.
      boolean isBusy()
      Returns whether this service has any work in progress.
      void pause()
      Pauses the service.
      void pause​(long timeout)
      Pauses the service for a specified period of time.
      void restart()
      Restarts the service.
      void restart​(java.lang.String message)
      Restarts the service.
      void resume()
      Continues the service after it has been paused.
      void setServiceStateListener​(ServiceStateListener serviceStateListener)
      Sets the service state listener.
      void start()
      Starts the service.
      void stop()
      Stops the service.
    • Method Detail

      • getServiceName

        java.lang.String getServiceName()
        Returns the name of this service.
        Returns:
        the name of this service
      • setServiceStateListener

        void setServiceStateListener​(ServiceStateListener serviceStateListener)
        Sets the service state listener.
        Parameters:
        serviceStateListener - the new service state listener
      • start

        void start()
            throws java.lang.Exception
        Starts the service.
        Throws:
        java.lang.Exception - if the service control fails
      • restart

        void restart()
              throws java.lang.Exception
        Restarts the service.
        Throws:
        java.lang.Exception - if the service control fails
      • restart

        void restart​(java.lang.String message)
              throws java.lang.Exception
        Restarts the service.
        Parameters:
        message - the message to be delivered to the system before restart
        Throws:
        java.lang.Exception - if the service control fails
      • pause

        void pause()
            throws java.lang.Exception
        Pauses the service.
        Throws:
        java.lang.Exception - if the service control fails
      • pause

        void pause​(long timeout)
            throws java.lang.Exception
        Pauses the service for a specified period of time.
        Parameters:
        timeout - the maximum time to wait in milliseconds.
        Throws:
        java.lang.Exception - if the service control fails
      • resume

        void resume()
             throws java.lang.Exception
        Continues the service after it has been paused.
        Throws:
        java.lang.Exception - if the service control fails
      • stop

        void stop()
        Stops the service. Destroys any services and resources that are dependent on this service.
      • isActive

        boolean isActive()
        Returns whether this service is currently started and active.
        Returns:
        true, if the service is active; false otherwise
      • isBusy

        boolean isBusy()
        Returns whether this service has any work in progress.
        Returns:
        true, if this service is busy; false otherwise