NotificationBroadcasterSupport (Java SE 16 & JDK 16) (original) (raw)

All Implemented Interfaces:

[NotificationBroadcaster](NotificationBroadcaster.html "interface in javax.management"), [NotificationEmitter](NotificationEmitter.html "interface in javax.management")

Direct Known Subclasses:

[JMXConnectorServer](remote/JMXConnectorServer.html "class in javax.management.remote"), [Monitor](monitor/Monitor.html "class in javax.management.monitor"), [RelationService](relation/RelationService.html "class in javax.management.relation"), [Timer](timer/Timer.html "class in javax.management.timer")


Provides an implementation of NotificationEmitter interface. This can be used as the super class of an MBean that sends notifications.

By default, the notification dispatch model is synchronous. That is, when a thread calls sendNotification, theNotificationListener.handleNotification method of each listener is called within that thread. You can override this default by overriding handleNotification in a subclass, or by passing an Executor to the constructor.

If the method call of a filter or listener throws an Exception, then that exception does not prevent other listeners from being invoked. However, if the method call of a filter or of Executor.execute or ofhandleNotification (when no Excecutor is specified) throws anError, then that Error is propagated to the caller ofsendNotification.

Remote listeners added using the JMX Remote API (see JMXConnector) are not usually called synchronously. That is, when sendNotification returns, it is not guaranteed that any remote listeners have yet received the notification.

Since:

1.5

Constructors
Constructs a NotificationBroadcasterSupport where each listener is invoked by the thread sending the notification.
Constructs a NotificationBroadcasterSupport where each listener is invoked using the given Executor.
Constructs a NotificationBroadcasterSupport with information about the notifications that may be sent, and where each listener is invoked using the given Executor.
Constructs a NotificationBroadcasterSupport with information about the notifications that may be sent.

void
Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.
protected void
This method is called by sendNotification for each listener in order to send the notification to that listener.
void
Removes a listener from this MBean.
void
Removes a listener from this MBean.
void

Methods declared in class java.lang.Object

[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)