T
- public abstract class AbstractNotifier<T extends Notification> extends java.lang.Object implements Observable<T>
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.ScheduledExecutorService |
executor |
protected NotificationSystem |
notifySystem |
Modifier | Constructor and Description |
---|---|
protected |
AbstractNotifier(NotificationSystem notifySystem,
java.util.concurrent.ScheduledExecutorService executor) |
Modifier and Type | Method and Description |
---|---|
void |
registerListener(Listener<T> listener)
Register listener for notification type T.
|
void |
unregisterAllListeners()
Remove all listeners for a given type.
|
void |
unregisterListener(Listener<T> listener)
Remove a listener.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getType
protected final NotificationSystem notifySystem
protected final java.util.concurrent.ScheduledExecutorService executor
protected AbstractNotifier(NotificationSystem notifySystem, java.util.concurrent.ScheduledExecutorService executor)
public void unregisterListener(Listener<T> listener)
Observable
unregisterListener
in interface Observable<T extends Notification>
listener
- the listener which needs to be removed.public void unregisterAllListeners()
Observable
unregisterAllListeners
in interface Observable<T extends Notification>
public void registerListener(Listener<T> listener)
Observable
registerListener
in interface Observable<T extends Notification>
listener
- This is the listener which will be invoked incase of an Notification.