Package jadex.platform.service.cli
Class CliShell
- java.lang.Object
- 
- jadex.platform.service.cli.ACliShell
- 
- jadex.platform.service.cli.CliShell
 
 
- 
 public class CliShell extends ACliShell The cli shell contains the commands and allows for executing a command. Use addAllCommandsFromClassPath() to add all commands from the current classpath or addCommand() to add them manually.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.ClassLoaderclThe class loader.protected java.util.Map<java.lang.String,ICliCommand>commandsThe commands.protected CliContextcontextThe context.protected java.lang.StringpromptThe prompt.protected ACliShellsubshellThe subshells.- 
Fields inherited from class jadex.platform.service.cli.ACliShellsessionid, workingdir
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>addAllCommandsFromClassPath()Add all commands from classpath.IFuture<java.lang.Void>addCommand(ICliCommand cmd)Add a command.voidaddSubshell(ACliShell subshell)Add a subshell.IFuture<java.lang.String>doExecuteCommand(java.lang.String line)Do execute a command line command and get back the results.IFuture<java.lang.String>executeCommand(java.lang.String line)Execute a command line command and get back the results.java.util.Map<java.lang.String,ICliCommand>getCommands()Get the commands.java.lang.StringgetPrompt()Get the promt only for this shell part.IFuture<java.lang.String>internalGetShellPrompt()Get the complete prompt (internal method).IFuture<java.lang.Boolean>removeSubshell()Remove a subshell.- 
Methods inherited from class jadex.platform.service.cli.ACliShellgetSessionId, getShellPrompt, getWorkingDir, setWorkingDir
 
- 
 
- 
- 
- 
Field Detail- 
commandsprotected java.util.Map<java.lang.String,ICliCommand> commands The commands.
 - 
contextprotected CliContext context The context.
 - 
subshellprotected ACliShell subshell The subshells.
 - 
promptprotected java.lang.String prompt The prompt.
 - 
clprotected java.lang.ClassLoader cl The class loader.
 
- 
 - 
Constructor Detail- 
CliShellpublic CliShell(java.lang.Object context, java.lang.String prompt, Tuple2<java.lang.String,java.lang.Integer> sessionid, java.lang.ClassLoader cl)Create a new cli.
 
- 
 - 
Method Detail- 
addAllCommandsFromClassPathpublic IFuture<java.lang.Void> addAllCommandsFromClassPath() Add all commands from classpath.- Specified by:
- addAllCommandsFromClassPathin class- ACliShell
- Parameters:
- cl- The classloader to use.
 
 - 
addCommandpublic IFuture<java.lang.Void> addCommand(ICliCommand cmd) Add a command.- Specified by:
- addCommandin class- ACliShell
- Parameters:
- cmd- The command.
 
 - 
getCommandspublic java.util.Map<java.lang.String,ICliCommand> getCommands() Get the commands.- Specified by:
- getCommandsin class- ACliShell
- Returns:
- The commands.
 
 - 
executeCommandpublic IFuture<java.lang.String> executeCommand(java.lang.String line) Execute a command line command and get back the results.- Specified by:
- executeCommandin class- ACliShell
- Parameters:
- command- The command.
- Returns:
- The result of the command.
 
 - 
doExecuteCommandpublic IFuture<java.lang.String> doExecuteCommand(java.lang.String line) Do execute a command line command and get back the results.- Parameters:
- command- The command.
- Returns:
- The result of the command.
 
 - 
addSubshellpublic void addSubshell(ACliShell subshell) Add a subshell.- Specified by:
- addSubshellin class- ACliShell
 
 - 
removeSubshellpublic IFuture<java.lang.Boolean> removeSubshell() Remove a subshell.- Specified by:
- removeSubshellin class- ACliShell
 
 - 
internalGetShellPromptpublic IFuture<java.lang.String> internalGetShellPrompt() Get the complete prompt (internal method). Calls subshells getPrompt().- Specified by:
- internalGetShellPromptin class- ACliShell
- Returns:
- the complete prompt;
 
 - 
getPromptpublic java.lang.String getPrompt() Get the promt only for this shell part.- Returns:
- The local promt part.
 
 
- 
 
-