org.springframework.roo.shell
Interface Shell

All Superinterfaces:
ShellPromptAccessor, ShellStatusProvider
All Known Implementing Classes:
AbstractShell

public interface Shell
extends ShellStatusProvider, ShellPromptAccessor

Specifies the contract for an interactive shell.

Any interactive shell class which implements these methods can be launched by the roo-bootstrap mechanism.

It is envisaged implementations will be provided for JLine initially, with possible implementations for Eclipse in the future.

Since:
1.0
Author:
Ben Alex

Method Summary
 boolean executeCommand(String line)
          Runs the specified command.
 ExitShellRequest getExitShellRequest()
           
 File getHome()
          Returns the home directory of the current running shell instance
 boolean isDevelopmentMode()
           
 void promptLoop()
          Presents a console prompt and allows the user to interact with the shell.
 void setDevelopmentMode(boolean developmentMode)
          Indicates the shell should switch into a lower-level development mode.
 void setPromptPath(String path)
          Changes the "path" displayed in the shell prompt.
 
Methods inherited from interface org.springframework.roo.shell.event.ShellStatusProvider
addShellStatusListener, getShellStatus, removeShellStatusListener
 
Methods inherited from interface org.springframework.roo.shell.ShellPromptAccessor
getShellPrompt
 

Method Detail

promptLoop

void promptLoop()
Presents a console prompt and allows the user to interact with the shell. The shell should not return to the caller until the user has finished their session (by way of a "quit" or similar command).


getExitShellRequest

ExitShellRequest getExitShellRequest()
Returns:
null if no exit was requested, otherwise the last exit code indicated to the shell to use

executeCommand

boolean executeCommand(String line)
Runs the specified command. Control will return to the caller after the command is run.

Parameters:
line - to execute (required)
Returns:
true if the command was successful, false if there was an exception

setDevelopmentMode

void setDevelopmentMode(boolean developmentMode)
Indicates the shell should switch into a lower-level development mode. The exact meaning varies by shell implementation.

Parameters:
developmentMode - true if development mode should be enabled, false otherwise

isDevelopmentMode

boolean isDevelopmentMode()

setPromptPath

void setPromptPath(String path)
Changes the "path" displayed in the shell prompt. An implementation will ensure this path is included on the screen, taking care to merge it with the product name and handle any special formatting requirements (such as ANSI, if supported by the implementation).

Parameters:
path - to set (can be null or empty; must NOT be formatted in any special way eg ANSI codes)

getHome

File getHome()
Returns the home directory of the current running shell instance

Returns:
the home directory of the current shell instance


Copyright © 2009-2010 VMware, Inc. All Rights Reserved.