1 package org.springframework.roo.shell.event;
2
3 /**
4 * Implemented by shells that support the publication of shell status changes.
5 *
6 * <p>
7 * Implementations are not required to provide any guarantees with respect to the order
8 * in which notifications are delivered to listeners.
9 *
10 * <p>
11 * Implementations must permit modification of the listener list, even while delivering
12 * event notifications to listeners. However, listeners do not receive any guarantee that
13 * their addition or removal from the listener list will be effective or not for any event
14 * notification that is currently proceeding.
15 *
16 * <p>
17 * Implementations must ensure that status notifications are only delivered when an actual
18 * change has taken place.
19 *
20 * @author Ben Alex
21 * @since 1.0
22 *
23 */
24 public interface ShellStatusProvider {
25
26 /**
27 * Registers a new status listener.
28 *
29 * @param shellStatusListener to register (cannot be null)
30 */
31 void addShellStatusListener(ShellStatusListener shellStatusListener);
32
33 /**
34 * Removes an existing status listener.
35 *
36 * <p>
37 * If the presented status listener is not found, the method returns without exception.
38 *
39 * @param shellStatusListener to remove (cannot be null)
40 */
41 void removeShellStatusListener(ShellStatusListener shellStatusListener);
42
43 /**
44 * Returns the current shell status.
45 *
46 * @return the current status (never null)
47 */
48 ShellStatus getShellStatus();
49 }