Class AbstractShellService

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

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

    Created: 2017. 10. 30.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterContextLoaded()  
      protected void destroySessionManager()  
      java.lang.String getGreetings()
      Returns the greeting message.
      protected void initSessionManager()  
      boolean isBusy()  
      boolean isExposable​(java.lang.String transletName)
      Returns whether or not the translet can be exposed to the shell service.
      boolean isVerbose()
      Tests if the verbose mode is enabled.
      com.aspectran.core.adapter.SessionAdapter newSessionAdapter()
      Create and return a new session adapter from the shell service.
      void printGreetings()
      Prints greeting message.
      void printHelp()
      Prints help information.
      void restart​(java.lang.String message)  
      void setGreetings​(java.lang.String greetings)
      Specifies the greeting message.
      void setVerbose​(boolean verbose)
      Enables or disables the verbose mode.
      • Methods inherited from class com.aspectran.core.service.AspectranCoreService

        beforeContextDestroy, doPause, doPause, doResume, doStart, doStop
      • Methods inherited from class com.aspectran.core.service.AbstractCoreService

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

        clearDerivedService, getLock, getServiceName, isActive, joinDerivedService, pause, pause, restart, resume, setServiceStateListener, start, stop, withdrawDerivedService
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.aspectran.core.service.CoreService

        getActivityContext, getAspectranClassLoader, getAspectranConfig, getBasePath, getDefaultActivity, getSchedulerService, getServiceController, isDerived, isHardReload, isLateStart, joinDerivedService, leaveFromRootService, withdrawDerivedService
    • Constructor Detail

      • AbstractShellService

        protected AbstractShellService​(Console console)
    • Method Detail

      • afterContextLoaded

        public void afterContextLoaded()
                                throws java.lang.Exception
        Overrides:
        afterContextLoaded in class com.aspectran.core.service.AspectranCoreService
        Throws:
        java.lang.Exception
      • 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 java.lang.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​(java.lang.String greetings)
        Description copied from interface: ShellService
        Specifies the greeting message.
        Specified by:
        setGreetings in interface ShellService
        Parameters:
        greetings - the greeting message
      • 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
      • isExposable

        public boolean isExposable​(java.lang.String transletName)
        Description copied from interface: ShellService
        Returns whether or not the translet can be exposed to the shell service.
        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
      • newSessionAdapter

        public com.aspectran.core.adapter.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
      • initSessionManager

        protected void initSessionManager()
      • destroySessionManager

        protected void destroySessionManager()