Package com.aspectran.shell.service
Interface ShellService
-
- All Superinterfaces:
com.aspectran.core.service.CoreService
- All Known Implementing Classes:
AbstractShellService,AspectranShellService
public interface ShellService extends com.aspectran.core.service.CoreServiceThe Interface ShellService.Created: 2017. 10. 28.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexecute(CommandLineParser commandLineParser)Executes a Shell Activity.voidexecute(java.lang.String command)Executes a Shell Activity.CommandRegistrygetCommandRegistry()java.lang.String[]getCommands()ConsolegetConsole()Returns the console.java.lang.StringgetGreetings()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.voidrelease()Stop the service and release all allocated resources.static ShellServicerun(java.io.File aspectranConfigFile)Run the Shell Service, creating and starting a newShellService.static ShellServicerun(java.io.File aspectranConfigFile, Console console)Run the Shell Service, creating and starting a newShellService.voidsetGreetings(java.lang.String greetings)voidsetVerbose(boolean verbose)Enables or disables the verbose mode.
-
-
-
Method Detail
-
newSessionAdapter
com.aspectran.core.adapter.SessionAdapter newSessionAdapter()
Creates a new session adapter for the shell service and returns.- Returns:
- the session adapter
-
getConsole
Console getConsole()
Returns the console.- Returns:
- the console
-
getCommands
java.lang.String[] getCommands()
-
getCommandRegistry
CommandRegistry getCommandRegistry()
-
isVerbose
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.- Returns:
- true if the verbose mode is enabled
-
setVerbose
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.- Parameters:
verbose- true to enable the verbose mode; false to disable
-
getGreetings
java.lang.String getGreetings()
-
setGreetings
void setGreetings(java.lang.String greetings)
-
printGreetings
void printGreetings()
Prints welcome message.
-
printHelp
void printHelp()
Prints help information.
-
isExposable
boolean isExposable(java.lang.String transletName)
Checks whether the Translet can be exposed.- Parameters:
transletName- the name of the Translet to check- Returns:
- true if the Translet can be exposed; false otherwise
-
execute
void execute(java.lang.String command)
Executes a Shell Activity.- Parameters:
command- the command
-
execute
void execute(CommandLineParser commandLineParser)
Executes a Shell Activity.- Parameters:
commandLineParser- the command line parser
-
release
void release()
Stop the service and release all allocated resources.
-
run
static ShellService run(java.io.File aspectranConfigFile)
Run the Shell Service, creating and starting a newShellService.- Parameters:
aspectranConfigFile- the aspectran configuration file- Returns:
- the instance of
ShellService
-
run
static ShellService run(java.io.File aspectranConfigFile, Console console)
Run the Shell Service, creating and starting a newShellService.- Parameters:
aspectranConfigFile- the aspectran configuration fileconsole- the console- Returns:
- the instance of
ShellService
-
-