Class AbstractShellService

  • All Implemented Interfaces:
    com.aspectran.core.service.CoreService, com.aspectran.core.service.ServiceController, ShellService
    Direct Known Subclasses:
    AspectranShellService

    public abstract class AbstractShellService
    extends com.aspectran.core.service.AspectranCoreService
    implements ShellService
    Abstract base class for ShellService implementations.

    Created: 2017. 10. 30.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractShellService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterContextLoaded()  
      void beforeContextDestroy()  
      CommandRegistry getCommandRegistry()  
      java.lang.String[] getCommands()  
      Console getConsole()
      Returns the console.
      java.lang.String getGreetings()  
      boolean isBusy()  
      boolean isExposable​(java.lang.String transletName)
      Checks whether the Translet can be exposed.
      boolean isVerbose()
      Tests if the verbose mode is enabled.
      com.aspectran.core.adapter.SessionAdapter newSessionAdapter()
      Creates a new session adapter for the shell service and returns.
      void printGreetings()
      Prints welcome message.
      void printHelp()
      Prints help information.
      void restart()  
      void restart​(java.lang.String message)  
      protected void setCommands​(java.lang.String[] commands)  
      protected void setConsole​(Console console)  
      void setGreetings​(java.lang.String greetings)  
      void setVerbose​(boolean verbose)
      Enables or disables the verbose mode.
      • Methods inherited from class com.aspectran.core.service.AbstractCoreService

        createSchedulerService, destroyActivityContext, determineBasePath, getActivityContext, getApplicationAdapter, getAspectranClassLoader, getAspectranConfig, getBasePath, getServiceController, isDerived, isHardReload, isLateStart, joinDerivedService, loadActivityContext, prepare, setActivityContext, setBasePath, setExposals
      • Methods inherited from class com.aspectran.core.service.AbstractServiceController

        getLock, getServiceName, isActive, joinDerivedService, pause, pause, resume, setServiceStateListener, start, stop
      • Methods inherited from class com.aspectran.core.service.AspectranCoreService

        doPause, doPause, doRestart, doResume, doStart, doStop
      • Methods inherited from interface com.aspectran.core.service.CoreService

        getActivityContext, getApplicationAdapter, getAspectranClassLoader, getAspectranConfig, getBasePath, getServiceController, isHardReload, isLateStart, joinDerivedService
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractShellService

        protected AbstractShellService()
    • Method Detail

      • afterContextLoaded

        public void afterContextLoaded()
                                throws java.lang.Exception
        Overrides:
        afterContextLoaded in class com.aspectran.core.service.AspectranCoreService
        Throws:
        java.lang.Exception
      • beforeContextDestroy

        public void beforeContextDestroy()
        Overrides:
        beforeContextDestroy in class com.aspectran.core.service.AspectranCoreService
      • newSessionAdapter

        public com.aspectran.core.adapter.SessionAdapter newSessionAdapter()
        Description copied from interface: ShellService
        Creates a new session adapter for the shell service and returns.
        Specified by:
        newSessionAdapter in interface ShellService
        Returns:
        the session adapter
      • setConsole

        protected void setConsole​(Console console)
      • setCommands

        protected void setCommands​(java.lang.String[] commands)
      • isExposable

        public boolean isExposable​(java.lang.String transletName)
        Description copied from interface: ShellService
        Checks whether the Translet can be exposed.
        Specified by:
        isExposable in interface ShellService
        Overrides:
        isExposable in class com.aspectran.core.service.AbstractCoreService
        Parameters:
        transletName - the name of the Translet to check
        Returns:
        true if the Translet can be exposed; false otherwise
      • 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
      • setGreetings

        public void setGreetings​(java.lang.String greetings)
        Specified by:
        setGreetings in interface ShellService
      • restart

        public void restart()
                     throws java.lang.Exception
        Specified by:
        restart in interface com.aspectran.core.service.ServiceController
        Overrides:
        restart in class com.aspectran.core.service.AbstractServiceController
        Throws:
        java.lang.Exception
      • restart

        public void restart​(java.lang.String message)
                     throws java.lang.Exception
        Specified by:
        restart in interface com.aspectran.core.service.ServiceController
        Overrides:
        restart in class com.aspectran.core.service.AbstractServiceController
        Throws:
        java.lang.Exception
      • isBusy

        public boolean isBusy()
        Specified by:
        isBusy in interface com.aspectran.core.service.ServiceController
        Overrides:
        isBusy in class com.aspectran.core.service.AbstractServiceController