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:
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 forShellServiceimplementations.Created: 2017. 10. 30.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractShellService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterContextLoaded()voidbeforeContextDestroy()CommandRegistrygetCommandRegistry()java.lang.String[]getCommands()ConsolegetConsole()Returns the console.java.lang.StringgetGreetings()booleanisBusy()booleanisExposable(java.lang.String transletName)Checks whether the Translet can be exposed.booleanisVerbose()Tests if the verbose mode is enabled.com.aspectran.core.adapter.SessionAdapternewSessionAdapter()Creates a new session adapter for the shell service and returns.voidprintGreetings()Prints welcome message.voidprintHelp()Prints help information.voidrestart()voidrestart(java.lang.String message)protected voidsetCommands(java.lang.String[] commands)protected voidsetConsole(Console console)voidsetGreetings(java.lang.String greetings)voidsetVerbose(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
-
Methods inherited from interface com.aspectran.shell.service.ShellService
execute, execute, release
-
-
-
-
Method Detail
-
afterContextLoaded
public void afterContextLoaded() throws java.lang.Exception- Overrides:
afterContextLoadedin classcom.aspectran.core.service.AspectranCoreService- Throws:
java.lang.Exception
-
beforeContextDestroy
public void beforeContextDestroy()
- Overrides:
beforeContextDestroyin classcom.aspectran.core.service.AspectranCoreService
-
newSessionAdapter
public com.aspectran.core.adapter.SessionAdapter newSessionAdapter()
Description copied from interface:ShellServiceCreates a new session adapter for the shell service and returns.- Specified by:
newSessionAdapterin interfaceShellService- Returns:
- the session adapter
-
getConsole
public Console getConsole()
Description copied from interface:ShellServiceReturns the console.- Specified by:
getConsolein interfaceShellService- Returns:
- the console
-
setConsole
protected void setConsole(Console console)
-
getCommands
public java.lang.String[] getCommands()
- Specified by:
getCommandsin interfaceShellService
-
setCommands
protected void setCommands(java.lang.String[] commands)
-
getCommandRegistry
public CommandRegistry getCommandRegistry()
- Specified by:
getCommandRegistryin interfaceShellService
-
isExposable
public boolean isExposable(java.lang.String transletName)
Description copied from interface:ShellServiceChecks whether the Translet can be exposed.- Specified by:
isExposablein interfaceShellService- Overrides:
isExposablein classcom.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:
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()
- Specified by:
getGreetingsin interfaceShellService
-
setGreetings
public void setGreetings(java.lang.String greetings)
- Specified by:
setGreetingsin interfaceShellService
-
printGreetings
public void printGreetings()
Description copied from interface:ShellServicePrints welcome message.- Specified by:
printGreetingsin interfaceShellService
-
printHelp
public void printHelp()
Description copied from interface:ShellServicePrints help information.- Specified by:
printHelpin interfaceShellService
-
restart
public void restart() throws java.lang.Exception- Specified by:
restartin interfacecom.aspectran.core.service.ServiceController- Overrides:
restartin classcom.aspectran.core.service.AbstractServiceController- Throws:
java.lang.Exception
-
restart
public void restart(java.lang.String message) throws java.lang.Exception- Specified by:
restartin interfacecom.aspectran.core.service.ServiceController- Overrides:
restartin classcom.aspectran.core.service.AbstractServiceController- Throws:
java.lang.Exception
-
isBusy
public boolean isBusy()
- Specified by:
isBusyin interfacecom.aspectran.core.service.ServiceController- Overrides:
isBusyin classcom.aspectran.core.service.AbstractServiceController
-
-