org.springframework.shell.event
Class AbstractShellStatusPublisher

java.lang.Object
  extended by org.springframework.shell.event.AbstractShellStatusPublisher
All Implemented Interfaces:
ShellStatusProvider
Direct Known Subclasses:
AbstractShell

public abstract class AbstractShellStatusPublisher
extends Object
implements ShellStatusProvider

Provides a convenience superclass for those shells wishing to publish status messages.

Since:
1.0

Field Summary
protected  ShellStatus shellStatus
           
protected  Set<ShellStatusListener> shellStatusListeners
           
 
Constructor Summary
AbstractShellStatusPublisher()
           
 
Method Summary
 void addShellStatusListener(ShellStatusListener shellStatusListener)
          Registers a new status listener.
 ShellStatus getShellStatus()
          Returns the current shell status.
 void removeShellStatusListener(ShellStatusListener shellStatusListener)
          Removes an existing status listener.
protected  void setShellStatus(ShellStatus.Status shellStatus)
           
protected  void setShellStatus(ShellStatus.Status shellStatus, String msg, ParseResult parseResult)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shellStatusListeners

protected Set<ShellStatusListener> shellStatusListeners

shellStatus

protected ShellStatus shellStatus
Constructor Detail

AbstractShellStatusPublisher

public AbstractShellStatusPublisher()
Method Detail

addShellStatusListener

public final void addShellStatusListener(ShellStatusListener shellStatusListener)
Description copied from interface: ShellStatusProvider
Registers a new status listener.

Specified by:
addShellStatusListener in interface ShellStatusProvider
Parameters:
shellStatusListener - to register (cannot be null)

removeShellStatusListener

public final void removeShellStatusListener(ShellStatusListener shellStatusListener)
Description copied from interface: ShellStatusProvider
Removes an existing status listener.

If the presented status listener is not found, the method returns without exception.

Specified by:
removeShellStatusListener in interface ShellStatusProvider
Parameters:
shellStatusListener - to remove (cannot be null)

getShellStatus

public final ShellStatus getShellStatus()
Description copied from interface: ShellStatusProvider
Returns the current shell status.

Specified by:
getShellStatus in interface ShellStatusProvider
Returns:
the current status (never null)

setShellStatus

protected void setShellStatus(ShellStatus.Status shellStatus)

setShellStatus

protected void setShellStatus(ShellStatus.Status shellStatus,
                              String msg,
                              ParseResult parseResult)