public class NotificationSystem
extends java.lang.Object
Constructor and Description |
---|
NotificationSystem() |
Modifier and Type | Method and Description |
---|---|
<T extends Notification> |
addListeners(java.lang.String type,
Listener<T> listener,
java.util.concurrent.ScheduledExecutorService executor) |
boolean |
isListenerPresent(java.lang.String type)
Check if a Listener is present for a given notification type.
|
<T extends Notification> |
notify(T notification)
This method will ensure the notification is intimated to the listeners of the same type.
|
<T extends Notification> |
removeListener(java.lang.String type,
Listener<T> listener)
Remove Listener of a given notification type.
|
void |
removeListeners(java.lang.String type)
Remove all listeners of a notification type.
|
public <T extends Notification> void addListeners(java.lang.String type, Listener<T> listener, java.util.concurrent.ScheduledExecutorService executor)
public <T extends Notification> void notify(T notification)
T
- Type of notification.notification
- Notification to be notified.public <T extends Notification> void removeListener(java.lang.String type, Listener<T> listener)
T
- Type of notification.type
- Type of notification listener.listener
- Listener to be removed.public void removeListeners(java.lang.String type)
type
- Type of notification listener.public boolean isListenerPresent(java.lang.String type)
type
- Type of notification listener.