org.springframework.shell.event
Class AbstractShellStatusPublisher
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
shellStatusListeners
protected Set<ShellStatusListener> shellStatusListeners
shellStatus
protected ShellStatus shellStatus
AbstractShellStatusPublisher
public AbstractShellStatusPublisher()
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)