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:
AspectranShellService
public abstract class AbstractShellService extends AspectranCoreService implements ShellService
Abstract base class forShellService
implementations.Created: 2017. 10. 30.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractShellService(Console console)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterContextLoaded()
This method is executed immediately after the ActivityContext is loaded.void
beforeContextDestroy()
This method executed just before the ActivityContext is destroyed.java.lang.String
getGreetings()
boolean
isBusy()
Returns whether this service has any work in progress.boolean
isExposable(java.lang.String transletName)
Checks whether the Translet can be exposed.boolean
isVerbose()
Tests if the verbose mode is enabled.SessionAdapter
newSessionAdapter()
Create and return a new session adapter from the shell service.void
printGreetings()
Prints welcome message.void
printHelp()
Prints help information.void
restart(java.lang.String message)
Restarts the service.void
setGreetings(java.lang.String greetings)
void
setVerbose(boolean verbose)
Enables or disables the verbose mode.-
Methods inherited from class com.aspectran.core.service.AspectranCoreService
doPause, doPause, doResume, doStart, doStop
-
Methods inherited from class com.aspectran.core.service.AbstractCoreService
destroyActivityContext, determineBasePath, getActivityContext, getApplicationAdapter, getAspectranClassLoader, getAspectranConfig, getBasePath, getSchedulerService, getServiceController, isDerived, isHardReload, isLateStart, joinDerivedService, loadActivityContext, prepare, setActivityContext, setBasePath, setExposals
-
Methods inherited from class com.aspectran.core.service.AbstractServiceController
clearDerivedService, getLock, getServiceName, isActive, joinDerivedService, pause, pause, restart, resume, setServiceStateListener, start, stop
-
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, getApplicationAdapter, getAspectranClassLoader, getAspectranConfig, getBasePath, getServiceController, isHardReload, isLateStart, joinDerivedService
-
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.Exception
Description copied from class:AspectranCoreService
This method is executed immediately after the ActivityContext is loaded.- Overrides:
afterContextLoaded
in classAspectranCoreService
- Throws:
java.lang.Exception
- if an error occurs
-
beforeContextDestroy
public void beforeContextDestroy()
Description copied from class:AspectranCoreService
This method executed just before the ActivityContext is destroyed.- Overrides:
beforeContextDestroy
in classAspectranCoreService
-
newSessionAdapter
public SessionAdapter 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
-
isExposable
public boolean isExposable(java.lang.String transletName)
Description copied from interface:ShellService
Checks whether the Translet can be exposed.- Specified by:
isExposable
in interfaceShellService
- Overrides:
isExposable
in classAbstractCoreService
- 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 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
public java.lang.String getGreetings()
- Specified by:
getGreetings
in interfaceShellService
-
setGreetings
public void setGreetings(java.lang.String greetings)
- Specified by:
setGreetings
in interfaceShellService
-
printGreetings
public void printGreetings()
Description copied from interface:ShellService
Prints welcome message.- Specified by:
printGreetings
in interfaceShellService
-
printHelp
public void printHelp()
Description copied from interface:ShellService
Prints help information.- Specified by:
printHelp
in interfaceShellService
-
restart
public void restart(java.lang.String message) throws java.lang.Exception
Description copied from interface:ServiceController
Restarts the service.- Specified by:
restart
in interfaceServiceController
- Overrides:
restart
in 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:ServiceController
Returns whether this service has any work in progress.- Specified by:
isBusy
in interfaceServiceController
- Overrides:
isBusy
in classAbstractServiceController
- Returns:
- true, if this service is busy; false otherwise
-
-