Methods Summary |
---|
public void | addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
final NotificationListenerInfo info =
new NotificationListenerInfo( listener, filter, handback );
mInfos.add( info );
|
public int | getListenerCount()
return mInfos.size();
|
private final boolean | handbacksEqual(java.lang.Object handback1, java.lang.Object handback2)
return( handback1 == handback2 );
|
private final boolean | listenersEqual(javax.management.NotificationListener listener1, javax.management.NotificationListener listener2)
return( listener1 == listener2 );
|
public java.util.List | removeNotificationListener(javax.management.NotificationListener listener)Remove all instances of the specified listener and return
their corresponding NotificationListenerInfo.
This behavior matches the behavior of
{@link javax.management.NotificationEmitter}.
final Iterator iter = mInfos.iterator();
final List<NotificationListenerInfo> results = new ArrayList<NotificationListenerInfo>();
while( iter.hasNext() )
{
final NotificationListenerInfo info =
(NotificationListenerInfo)iter.next();
if ( listenersEqual( listener, info.getListener() ) )
{
iter.remove();
results.add( info );
}
}
return( results );
|
public NotificationListenerInfo | removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)Remove the first instance of the specified listener/filter/handback
combination and return its corresponding NotificationListenerInfo.
This behavior matches the behavior of
{@link javax.management.NotificationEmitter}.
final Iterator iter = mInfos.iterator();
NotificationListenerInfo result = null;
while( iter.hasNext() )
{
final NotificationListenerInfo info =
(NotificationListenerInfo)iter.next();
if ( listenersEqual( listener, info.getListener() ) &&
handbacksEqual( handback, info.getHandback() ) )
{
iter.remove();
result = info;
break;
}
}
return( result );
|