Class AbstractShellService

All Implemented Interfaces:
CoreService, ServiceLifeCycle, ShellService
Direct Known Subclasses:
DefaultShellService

public abstract class AbstractShellService extends DefaultCoreService implements ShellService
Abstract base class for ShellService implementations.

Created: 2017. 10. 30.

  • Method Details

    • afterContextLoaded

      public void afterContextLoaded() throws Exception
      Description copied from class: DefaultCoreService
      This method is executed immediately after the ActivityContext is loaded.
      Overrides:
      afterContextLoaded in class DefaultCoreService
      Throws:
      Exception - if an error occurs
    • getConsole

      public ShellConsole getConsole()
      Specified by:
      getConsole in interface ShellService
    • isVerbose

      public boolean isVerbose()
      Tests if the verbose mode is enabled. If verbose mode is on, a detailed description is printed each time the command is executed. Returns a flag indicating whether to show the description or not.
      Specified by:
      isVerbose in interface ShellService
      Returns:
      true if the verbose mode is enabled
    • setVerbose

      public void setVerbose(boolean verbose)
      Enables or disables the verbose mode. If verbose mode is on, a detailed description is printed each time the command is executed. Sets a flag indicating whether to show the description or not.
      Specified by:
      setVerbose in interface ShellService
      Parameters:
      verbose - true to enable the verbose mode; false to disable
    • getGreetings

      public String getGreetings()
      Description copied from interface: ShellService
      Returns the greeting message.
      Specified by:
      getGreetings in interface ShellService
      Returns:
      the greeting message
    • setGreetings

      public void setGreetings(String greetings)
      Description copied from interface: ShellService
      Specifies the greeting message.
      Specified by:
      setGreetings in interface ShellService
      Parameters:
      greetings - the greeting message
    • printGreetings

      public void printGreetings()
      Description copied from interface: ShellService
      Prints greeting message.
      Specified by:
      printGreetings in interface ShellService
    • printHelp

      public void printHelp()
      Description copied from interface: ShellService
      Prints help information.
      Specified by:
      printHelp in interface ShellService
    • newSessionAdapter

      public SessionAdapter newSessionAdapter()
      Description copied from interface: ShellService
      Create and return a new session adapter from the shell service.
      Specified by:
      newSessionAdapter in interface ShellService
      Returns:
      the session adapter
    • createSessionManager

      protected void createSessionManager()
    • destroySessionManager

      protected void destroySessionManager()
    • restart

      public void restart(String message) throws Exception
      Description copied from interface: ServiceLifeCycle
      Restarts the service.
      Specified by:
      restart in interface ServiceLifeCycle
      Overrides:
      restart in class AbstractServiceLifeCycle
      Parameters:
      message - the message to be delivered to the system before restart
      Throws:
      Exception - if the service control fails
    • isBusy

      public boolean isBusy()
      Description copied from interface: ServiceLifeCycle
      Returns whether this service has any work in progress.
      Specified by:
      isBusy in interface ServiceLifeCycle
      Overrides:
      isBusy in class AbstractServiceLifeCycle
      Returns:
      true, if this service is busy; false otherwise
    • configure

      protected void configure(@NonNull AspectranConfig aspectranConfig)
      Overrides:
      configure in class DefaultCoreService