public interface Notifier
Modifier and Type | Interface and Description |
---|---|
static interface |
Notifier.Notification
Association of paths within a Container.
Note that if the Notification represents a delete, associated paths may not be valid within the container. |
static interface |
Notifier.NotificationListener
Implemented by people wanting notifications of changes within the notification object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
registerForNotifications(Notifier.Notification targets,
Notifier.NotificationListener callbackObject)
Registers for notifications within the target Containers/Entries
|
boolean |
removeListener(Notifier.NotificationListener listenerToRemove)
Removes a listener from THIS notifier.
|
boolean |
setNotificationOptions(long interval,
boolean useMBean) |
boolean registerForNotifications(Notifier.Notification targets, Notifier.NotificationListener callbackObject) throws java.lang.IllegalArgumentException
You can only register for notifications that are at paths within the container this notifier is from. Attempting to use this Notifier with other Containers or Entries (from unrelated containers, nested containers, or nested nested), will result in an IllegalArgumentException.
Note: listeners should be removed from the same notifier instance they are added to.
targets
- the locations to monitor for changecallbackObject
- the listener to notify if changes occur to entities in the target collection *java.lang.IllegalArgumentException
- if any Container within targets is a new root, or beneath a new root for this notifier, or a container associated with a different notifier.removeListener(NotificationListener)
boolean removeListener(Notifier.NotificationListener listenerToRemove)
Note: listeners should be removed from the same notifier instance they are added to.
listenerToRemove
- registerForNotifications(Notification, NotificationListener)
boolean setNotificationOptions(long interval, boolean useMBean)
interval
- interval to use in milliseconds. Not used if useMBean is true.useMBean
- true if should use mbean, rather than timed intervals.