Package com.aspectran.shell.service
Interface ShellService
-
- All Superinterfaces:
CoreService
- All Known Implementing Classes:
AbstractShellService
,AspectranShellService
public interface ShellService extends CoreService
The Interface ShellService.Created: 2017. 10. 28.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
execute(CommandLineParser commandLineParser)
Executes a Shell Activity.void
execute(java.lang.String command)
Executes a Shell Activity.CommandRegistry
getCommandRegistry()
java.lang.String[]
getCommands()
Console
getConsole()
Returns the console.java.lang.String
getGreetings()
boolean
isExposable(java.lang.String transletName)
Checks whether the Translet can be exposed.boolean
isVerbose()
Tests if the verbose mode is enabled.SessionAdapter
newSessionAdapter()
Creates a new session adapter for the shell service and returns.void
printGreetings()
Prints welcome message.void
printHelp()
Prints help information.void
release()
Stop the service and release all allocated resources.static ShellService
run(java.io.File aspectranConfigFile)
Creates and starts a new Aspectran Shell Service.static ShellService
run(java.io.File aspectranConfigFile, Console console)
Creates and starts a new Aspectran Shell Service.void
setGreetings(java.lang.String greetings)
void
setVerbose(boolean verbose)
Enables or disables the verbose mode.-
Methods inherited from interface com.aspectran.core.service.CoreService
getActivityContext, getApplicationAdapter, getAspectranClassLoader, getAspectranConfig, getBasePath, getServiceController, isHardReload, isLateStart, joinDerivedService
-
-
-
-
Method Detail
-
newSessionAdapter
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)
Creates and starts a new Aspectran Shell Service.- Parameters:
aspectranConfigFile
- the aspectran configuration file- Returns:
- the instance of
ShellService
-
run
static ShellService run(java.io.File aspectranConfigFile, Console console)
Creates and starts a new Aspectran Shell Service.- Parameters:
aspectranConfigFile
- the aspectran configuration fileconsole
- the console- Returns:
- the instance of
ShellService
-
-