org.springframework.shell.core
Class JLineShellComponent

java.lang.Object
  extended by org.springframework.shell.event.AbstractShellStatusPublisher
      extended by org.springframework.shell.core.AbstractShell
          extended by org.springframework.shell.core.JLineShell
              extended by org.springframework.shell.core.JLineShellComponent
All Implemented Interfaces:
Runnable, Aware, InitializingBean, ApplicationContextAware, Lifecycle, Phased, SmartLifecycle, Shell, ShellPromptAccessor, ShellStatusProvider

public class JLineShellComponent
extends JLineShell
implements SmartLifecycle, ApplicationContextAware, InitializingBean

Launcher for JLineShell.

Since:
1.1

Field Summary
 
Fields inherited from class org.springframework.shell.core.JLineShell
reader, statusListener
 
Fields inherited from class org.springframework.shell.core.AbstractShell
completionKeys, exitShellRequest, inBlockComment, logger, ROO_PROMPT, shellPrompt
 
Fields inherited from class org.springframework.shell.event.AbstractShellStatusPublisher
shellStatus, shellStatusListeners
 
Fields inherited from interface org.springframework.shell.core.Shell
WINDOW_TITLE_SLOT
 
Constructor Summary
JLineShellComponent()
           
 
Method Summary
 void afterPropertiesSet()
           
 void customizePlugin()
           
protected  ExecutionStrategy getExecutionStrategy()
           
protected  String getHistoryFileName()
          get history file name from provider.
protected  Parser getParser()
           
 int getPhase()
           
protected  String getProductName()
          get product name
protected  String getPromptText()
          get prompt text from provider.
 SimpleParser getSimpleParser()
           
 String getStartupNotifications()
           
protected  String getVersion()
          get version information
 String getWelcomeMessage()
          get the welcome message at start.
 boolean isAutoStartup()
           
 boolean isRunning()
           
 void printBannerAndWelcome()
           
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setPrintBanner(boolean printBanner)
           
 void start()
           
 void stop()
           
 void stop(Runnable callback)
           
 void waitForComplete()
          wait the shell command to complete by typing "quit" or "exit"
 
Methods inherited from class org.springframework.shell.core.JLineShell
closeShell, createAnsiWindowsReader, createConsoleReader, flash, getHistorySize, getHomeAsString, isDevelopmentMode, logCommandToOutput, promptLoop, run, setDevelopmentMode, setHistorySize, setPromptPath, setPromptPath
 
Methods inherited from class org.springframework.shell.core.AbstractShell
blockCommentBegin, blockCommentFinish, executeCommand, executeScriptLine, getExitShellRequest, getHome, getShellPrompt, handleExecutionResult, logCommandIfRequired, versionInfo
 
Methods inherited from class org.springframework.shell.event.AbstractShellStatusPublisher
addShellStatusListener, getShellStatus, removeShellStatusListener, setShellStatus, setShellStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.shell.core.Shell
executeCommand, getExitShellRequest, getHome
 
Methods inherited from interface org.springframework.shell.event.ShellStatusProvider
addShellStatusListener, getShellStatus, removeShellStatusListener
 
Methods inherited from interface org.springframework.shell.core.ShellPromptAccessor
getShellPrompt
 

Constructor Detail

JLineShellComponent

public JLineShellComponent()
Method Detail

getSimpleParser

public SimpleParser getSimpleParser()

isAutoStartup

public boolean isAutoStartup()
Specified by:
isAutoStartup in interface SmartLifecycle

stop

public void stop(Runnable callback)
Specified by:
stop in interface SmartLifecycle

getPhase

public int getPhase()
Specified by:
getPhase in interface Phased

start

public void start()
Specified by:
start in interface Lifecycle

stop

public void stop()
Specified by:
stop in interface Lifecycle

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Lifecycle

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

waitForComplete

public void waitForComplete()
wait the shell command to complete by typing "quit" or "exit"


getExecutionStrategy

protected ExecutionStrategy getExecutionStrategy()
Specified by:
getExecutionStrategy in class AbstractShell

getParser

protected Parser getParser()
Specified by:
getParser in class AbstractShell

getStartupNotifications

public String getStartupNotifications()
Overrides:
getStartupNotifications in class JLineShell

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

customizePlugin

public void customizePlugin()

getHistoryFileName

protected String getHistoryFileName()
get history file name from provider. The provider has highest order org.springframework.core.Ordered.getOder will win.

Specified by:
getHistoryFileName in class JLineShell
Returns:
history file name

getPromptText

protected String getPromptText()
get prompt text from provider. The provider has highest order org.springframework.core.Ordered.getOder will win.

Specified by:
getPromptText in class JLineShell
Returns:
prompt text

printBannerAndWelcome

public void printBannerAndWelcome()
Overrides:
printBannerAndWelcome in class JLineShell

getWelcomeMessage

public String getWelcomeMessage()
get the welcome message at start.

Returns:
welcome message

setPrintBanner

public void setPrintBanner(boolean printBanner)
Parameters:
printBanner - the printBanner to set

getProductName

protected String getProductName()
Description copied from class: JLineShell
get product name

Specified by:
getProductName in class JLineShell
Returns:
Product Name

getVersion

protected String getVersion()
Description copied from class: JLineShell
get version information

Overrides:
getVersion in class JLineShell
Returns:
Version