Package com.aspectran.shell.service
Class AbstractShellService
- java.lang.Object
-
- com.aspectran.core.service.AbstractServiceController
-
- com.aspectran.core.service.AbstractCoreService
-
- com.aspectran.core.service.AspectranCoreService
-
- com.aspectran.shell.service.AbstractShellService
-
- All Implemented Interfaces:
CoreService,ServiceController,ShellService
- Direct Known Subclasses:
DefaultShellService
public abstract class AbstractShellService extends AspectranCoreService implements ShellService
Abstract base class forShellServiceimplementations.Created: 2017. 10. 30.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractShellService(Console console)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterContextLoaded()This method is executed immediately after the ActivityContext is loaded.protected voiddestroySessionManager()java.lang.StringgetGreetings()Returns the greeting message.protected voidinitSessionManager()booleanisBusy()Returns whether this service has any work in progress.booleanisExposable(java.lang.String transletName)Returns whether or not the translet can be exposed to the shell service.booleanisVerbose()Tests if the verbose mode is enabled.SessionAdapternewSessionAdapter()Create and return a new session adapter from the shell service.voidprintGreetings()Prints greeting message.voidprintHelp()Prints help information.voidrestart(java.lang.String message)Restarts the service.voidsetGreetings(java.lang.String greetings)Specifies the greeting message.voidsetVerbose(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
-
Methods inherited from interface com.aspectran.shell.service.ShellService
translate
-
-
-
-
Constructor Detail
-
AbstractShellService
protected AbstractShellService(Console console)
-
-
Method Detail
-
afterContextLoaded
public void afterContextLoaded() throws java.lang.ExceptionDescription copied from class:AspectranCoreServiceThis method is executed immediately after the ActivityContext is loaded.- Overrides:
afterContextLoadedin classAspectranCoreService- Throws:
java.lang.Exception- if an error occurs
-
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:
isVerbosein interfaceShellService- 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:
setVerbosein interfaceShellService- Parameters:
verbose- true to enable the verbose mode; false to disable
-
getGreetings
public java.lang.String getGreetings()
Description copied from interface:ShellServiceReturns the greeting message.- Specified by:
getGreetingsin interfaceShellService- Returns:
- the greeting message
-
setGreetings
public void setGreetings(java.lang.String greetings)
Description copied from interface:ShellServiceSpecifies the greeting message.- Specified by:
setGreetingsin interfaceShellService- Parameters:
greetings- the greeting message
-
printGreetings
public void printGreetings()
Description copied from interface:ShellServicePrints greeting message.- Specified by:
printGreetingsin interfaceShellService
-
printHelp
public void printHelp()
Description copied from interface:ShellServicePrints help information.- Specified by:
printHelpin interfaceShellService
-
restart
public void restart(java.lang.String message) throws java.lang.ExceptionDescription copied from interface:ServiceControllerRestarts the service.- Specified by:
restartin interfaceServiceController- Overrides:
restartin classAbstractServiceController- Parameters:
message- the message to be delivered to the system before restart- Throws:
java.lang.Exception- if the service control fails
-
isBusy
public boolean isBusy()
Description copied from interface:ServiceControllerReturns whether this service has any work in progress.- Specified by:
isBusyin interfaceServiceController- Overrides:
isBusyin classAbstractServiceController- Returns:
- true, if this service is busy; false otherwise
-
isExposable
public boolean isExposable(java.lang.String transletName)
Description copied from interface:ShellServiceReturns whether or not the translet can be exposed to the shell service.- Specified by:
isExposablein interfaceShellService- Overrides:
isExposablein classAbstractCoreService- Parameters:
transletName- the name of the translet to check- Returns:
- true if the translet can be exposed; false otherwise
-
newSessionAdapter
public SessionAdapter newSessionAdapter()
Description copied from interface:ShellServiceCreate and return a new session adapter from the shell service.- Specified by:
newSessionAdapterin interfaceShellService- Returns:
- the session adapter
-
initSessionManager
protected void initSessionManager()
-
destroySessionManager
protected void destroySessionManager()
-
-