|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.notification.ListenerRegistry
A notification listener registry.
For addition and removal, the registrations are deeply cloned to allow the registrations to be iterated externally without incurring the cost of synchronization.
Revisions:
20030806 Juha Lindfors:
ListenerRegistration
Nested Class Summary | |
class |
ListenerRegistry.ListenerRegistrationIterator
|
Constructor Summary | |
ListenerRegistry()
Create a notification listener registry using the default listener registration factory. |
|
ListenerRegistry(ListenerRegistrationFactory factory)
Create a notification listener registry using the passed listener registration factory. |
Method Summary | |
void |
add(NotificationListener listener,
NotificationFilter filter,
Object handback)
Adds a listener to a broadcaster |
boolean |
isEmpty()
Test whether the registry is empty |
ListenerRegistry.ListenerRegistrationIterator |
iterator()
Retrieve an iterator over the registrations |
void |
remove(NotificationListener listener)
Removes all registrations for a listener. |
void |
remove(NotificationListener listener,
NotificationFilter filter,
Object handback)
Removes only the registrations for a listener that match the filter and handback. |
void |
removeAll()
Removes all listeners from this listener registry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ListenerRegistry()
public ListenerRegistry(ListenerRegistrationFactory factory)
factory
- the factory to create registrations, use
null for the default factoryMethod Detail |
public void add(NotificationListener listener, NotificationFilter filter, Object handback) throws JMException
listener
- the listener to registerfilter
- filters the notifications in the broadcaster, can be nullhandback
- the object to include in the notification, can be null
IllegalArgumentException
- for a null listener
JMException
- for an error adding to the registrypublic void remove(NotificationListener listener) throws ListenerNotFoundException
listener
- the listener to remove
ListenerNotFoundException
- when the listener is not registeredpublic void remove(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
listener
- the listener to removefilter
- the filter of the registration to removehandback
- the handback object of the registration to remove
ListenerNotFoundException
- when the listener is not registeredpublic void removeAll()
public ListenerRegistry.ListenerRegistrationIterator iterator()
The iterator behaves like a snapshot of the registrations is taken during this operation.
public boolean isEmpty()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |