Methods Summary |
---|
public void | addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)Add a notification event listener to this MBean.
// --------------------------------------------------------- Public Methods
synchronized (entries) {
// Optimization to coalesce attribute name filters
if (filter instanceof BaseAttributeFilter) {
BaseAttributeFilter newFilter = (BaseAttributeFilter) filter;
Iterator items = entries.iterator();
while (items.hasNext()) {
BaseNotificationBroadcasterEntry item =
(BaseNotificationBroadcasterEntry) items.next();
if ((item.listener == listener) &&
(item.filter != null) &&
(item.filter instanceof BaseAttributeFilter) &&
(item.handback == handback)) {
BaseAttributeFilter oldFilter =
(BaseAttributeFilter) item.filter;
String newNames[] = newFilter.getNames();
String oldNames[] = oldFilter.getNames();
if (newNames.length == 0) {
oldFilter.clear();
} else {
if (oldNames.length != 0) {
for (int i = 0; i < newNames.length; i++)
oldFilter.addAttribute(newNames[i]);
}
}
return;
}
}
}
// General purpose addition of a new entry
entries.add(new BaseNotificationBroadcasterEntry
(listener, filter, handback));
}
|
public javax.management.MBeanNotificationInfo[] | getNotificationInfo()Return an MBeanNotificationInfo object describing the
notifications sent by this MBean.
return (new MBeanNotificationInfo[0]);
|
private synchronized void | registerNotifications(FixedNotificationFilter filter)
String names[]=filter.getNames();
Registry reg=Registry.getRegistry();
for( int i=0; i<names.length; i++ ) {
int code=reg.getId(null, names[i]);
if( hooks.length < code ) {
// XXX reallocate
throw new RuntimeException( "Too many hooks " + code );
}
NotificationListener listeners[]=hooks[code];
if( listeners== null ) {
}
}
|
public void | removeNotificationListener(javax.management.NotificationListener listener)Remove a notification event listener from this MBean.
synchronized (entries) {
Iterator items = entries.iterator();
while (items.hasNext()) {
BaseNotificationBroadcasterEntry item =
(BaseNotificationBroadcasterEntry) items.next();
if (item.listener == listener)
items.remove();
}
}
|
public void | removeNotificationListener(javax.management.NotificationListener listener, java.lang.Object handback)Remove a notification event listener from this MBean.
removeNotificationListener(listener);
|
public void | removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)Remove a notification event listener from this MBean.
removeNotificationListener(listener);
|
public void | sendNotification(javax.management.Notification notification)Send the specified notification to all interested listeners.
synchronized (entries) {
Iterator items = entries.iterator();
while (items.hasNext()) {
BaseNotificationBroadcasterEntry item =
(BaseNotificationBroadcasterEntry) items.next();
if ((item.filter != null) &&
(!item.filter.isNotificationEnabled(notification)))
continue;
item.listener.handleNotification(notification, item.handback);
}
}
|