Interface Observable<T>
-
- Type Parameters:
T
- The type of event that is to be observed.
- All Known Implementing Classes:
AbstractNotifier
,AbstractPollingNotifier
,EndOfDataNotifier
,SegmentNotifier
public interface Observable<T>
This represents an observable notification.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getType()
Get the notification type.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.
-
-
-
Method Detail
-
registerListener
void registerListener(Listener<T> listener)
Register listener for notification type T. Multiple listeners can be added for the same type.- Parameters:
listener
- This is the listener which will be invoked incase of an Notification.
-
unregisterListener
void unregisterListener(Listener<T> listener)
Remove a listener.- Parameters:
listener
- the listener which needs to be removed.
-
unregisterAllListeners
void unregisterAllListeners()
Remove all listeners for a given type.
-
getType
java.lang.String getType()
Get the notification type.- Returns:
- Notification type.
-
-