org.springframework.shell.event
Interface ShellStatusProvider

All Known Subinterfaces:
Shell
All Known Implementing Classes:
AbstractShell, AbstractShellStatusPublisher, JLineShell, JLineShellComponent

public interface ShellStatusProvider

Implemented by shells that support the publication of shell status changes.

Implementations are not required to provide any guarantees with respect to the order in which notifications are delivered to listeners.

Implementations must permit modification of the listener list, even while delivering event notifications to listeners. However, listeners do not receive any guarantee that their addition or removal from the listener list will be effective or not for any event notification that is currently proceeding.

Implementations must ensure that status notifications are only delivered when an actual change has taken place.

Since:
1.0

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.
 

Method Detail

addShellStatusListener

void addShellStatusListener(ShellStatusListener shellStatusListener)
Registers a new status listener.

Parameters:
shellStatusListener - to register (cannot be null)

removeShellStatusListener

void removeShellStatusListener(ShellStatusListener shellStatusListener)
Removes an existing status listener.

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

Parameters:
shellStatusListener - to remove (cannot be null)

getShellStatus

ShellStatus getShellStatus()
Returns the current shell status.

Returns:
the current status (never null)