Package com.aspectran.shell.service
Class AbstractShellService
java.lang.Object
com.aspectran.core.service.AbstractServiceLifeCycle
com.aspectran.core.service.AbstractCoreService
com.aspectran.core.service.DefaultCoreService
com.aspectran.shell.service.AbstractShellService
- All Implemented Interfaces:
CoreService
,ServiceLifeCycle
,ShellService
- Direct Known Subclasses:
DefaultShellService
Abstract base class for
ShellService
implementations.
Created: 2017. 10. 30.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is executed immediately after the ActivityContext is loaded.protected void
configure
(AspectranConfig aspectranConfig) protected void
protected void
Returns the greeting message.boolean
isBusy()
Returns whether this service has any work in progress.boolean
Tests if the verbose mode is enabled.Create and return a new session adapter from the shell service.void
Prints greeting message.void
Prints help information.void
Restarts the service.void
setGreetings
(String greetings) Specifies the greeting message.void
setVerbose
(boolean verbose) Enables or disables the verbose mode.Methods inherited from class com.aspectran.core.service.DefaultCoreService
beforeContextDestroy, buildActivityContext, destroyActivityContext, doStart, doStop, start, stop
Methods inherited from class com.aspectran.core.service.AbstractCoreService
buildSchedulerService, getActivityContext, getActivityContextBuilder, getAltClassLoader, getApplicationAdapter, getAspectranConfig, getBasePath, getDefaultActivity, getSchedulerService, getServiceClassLoader, getServiceLifeCycle, getServiceName, hasActivityContextBuilder, hasServiceClassLoader, isAcceptable, isDerived, setActivityContext, setActivityContextBuilder, setAltClassLoader, setAspectranConfig, setBasePath, setRequestAcceptor, setServiceClassLoader
Methods inherited from class com.aspectran.core.service.AbstractServiceLifeCycle
clearDerivedServices, getLock, getParentService, getRootService, isActive, isOrphan, isRootService, joinDerivedService, leaveFromRootService, pause, pause, restart, resume, setServiceStateListener, 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, getAltClassLoader, getApplicationAdapter, getAspectranConfig, getBasePath, getDefaultActivity, getParentService, getRootService, getSchedulerService, getServiceClassLoader, getServiceLifeCycle, hasServiceClassLoader, isAcceptable, isDerived, isOrphan, isRootService
Methods inherited from interface com.aspectran.shell.service.ShellService
translate
-
Method Details
-
afterContextLoaded
Description copied from class:DefaultCoreService
This method is executed immediately after the ActivityContext is loaded.- Overrides:
afterContextLoaded
in classDefaultCoreService
- Throws:
Exception
- if an error occurs
-
getConsole
- Specified by:
getConsole
in interfaceShellService
-
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 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:
setVerbose
in interfaceShellService
- Parameters:
verbose
- true to enable the verbose mode; false to disable
-
getGreetings
Description copied from interface:ShellService
Returns the greeting message.- Specified by:
getGreetings
in interfaceShellService
- Returns:
- the greeting message
-
setGreetings
Description copied from interface:ShellService
Specifies the greeting message.- Specified by:
setGreetings
in interfaceShellService
- Parameters:
greetings
- the greeting message
-
printGreetings
public void printGreetings()Description copied from interface:ShellService
Prints greeting message.- Specified by:
printGreetings
in interfaceShellService
-
printHelp
public void printHelp()Description copied from interface:ShellService
Prints help information.- Specified by:
printHelp
in interfaceShellService
-
newSessionAdapter
Description copied from interface:ShellService
Create and return a new session adapter from the shell service.- Specified by:
newSessionAdapter
in interfaceShellService
- Returns:
- the session adapter
-
createSessionManager
protected void createSessionManager() -
destroySessionManager
protected void destroySessionManager() -
restart
Description copied from interface:ServiceLifeCycle
Restarts the service.- Specified by:
restart
in interfaceServiceLifeCycle
- Overrides:
restart
in classAbstractServiceLifeCycle
- 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 interfaceServiceLifeCycle
- Overrides:
isBusy
in classAbstractServiceLifeCycle
- Returns:
- true, if this service is busy; false otherwise
-
configure
- Overrides:
configure
in classDefaultCoreService
-