Methods Summary |
---|
private void | addFilterTypeCounts(javax.management.NotificationFilter filter)
String[] types = getTypes( filter );
for( String type : types )
{
incrementListenerCountForType( type );
}
|
public void | addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
super.addNotificationListener( listener, filter, handback );
mListeners.addNotificationListener( listener, filter, handback );
addFilterTypeCounts( filter );
|
public synchronized void | cleanup()
if ( mSenderThread != null )
{
mSenderThread.quit();
mSenderThread = null;
}
|
private void | decrementListenerCountForType(java.lang.String type)
synchronized( mListenerTypeCounts )
{
final Integer count = mListenerTypeCounts.get( type );
if ( count == null )
{
throw new IllegalArgumentException( type );
}
final int oldValue = count.intValue();
if ( oldValue == 1 )
{
mListenerTypeCounts.remove( type );
}
else
{
mListenerTypeCounts.put( type, new Integer( oldValue - 1 ) );
}
}
|
public int | getListenerCount()
return( mListeners.getListenerCount() );
|
public int | getNotificationTypeListenerCount(java.lang.String type)
final Integer count = mListenerTypeCounts.get( type );
int resultCount = 0;
if ( count == null )
{
final Integer allCount = mListenerTypeCounts.get( WILDCARD_TYPE );
if ( allCount != null )
{
resultCount = allCount;
}
else
{
// no wildcards are in use
}
}
return( resultCount );
|
private synchronized com.sun.appserv.management.util.jmx.NotificationEmitterSupport$SenderThread | getSenderThread()
if ( mSenderThread == null )
{
mSenderThread = mAsyncDelivery ? new SenderThread() : null;
if ( mSenderThread != null )
{
mSenderThread.start();
}
}
return( mSenderThread );
|
private java.lang.String[] | getTypes(javax.management.NotificationFilter filter)
String[] types = NO_TYPES;
if ( filter instanceof NotificationFilterSupport )
{
final NotificationFilterSupport fs = (NotificationFilterSupport)filter;
types = ListUtil.toStringArray( fs.getEnabledTypes() );
}
else if ( filter instanceof AttributeChangeNotificationFilter )
{
types = ATTRIBUTE_CHANGE_TYPES;
}
else if ( filter instanceof MBeanServerNotificationFilter )
{
types = MBEAN_SERVER_NOTIFICATION_TYPES;
}
else
{
// no filter, or non-standard one, have to assume all types
types = ALL_TYPES;
}
return types;
|
private void | incrementListenerCountForType(java.lang.String type)
synchronized( mListenerTypeCounts )
{
final Integer count = mListenerTypeCounts.get( type );
final Integer newCount = (count == null ) ?
COUNT_1 : new Integer( count.intValue() + 1 );
mListenerTypeCounts.put( type, newCount );
}
|
protected void | internalSendNotification(javax.management.Notification notif)
super.sendNotification( notif );
|
private void | removeFilterTypeCounts(javax.management.NotificationFilter filter)
final String[] types = getTypes( filter );
for( String type : types )
{
decrementListenerCountForType( type );
}
|
private void | removeFilterTypeCounts(java.util.List infos)
for( NotificationListenerInfo info : infos )
{
removeFilterTypeCounts( info.getFilter() );
}
|
public void | removeNotificationListener(javax.management.NotificationListener listener)
super.removeNotificationListener( listener );
final List<NotificationListenerInfo> infos =
mListeners.removeNotificationListener( listener );
removeFilterTypeCounts( infos );
|
public void | removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
super.removeNotificationListener( listener, filter, handback );
mListeners.removeNotificationListener( listener );
if ( filter != null )
{
removeFilterTypeCounts( filter );
}
|
public void | sendAll()Synchronously (on current thread), ensure that all Notifications
have been delivered.
if ( mSenderThread != null )
{
mSenderThread.sendAll();
}
|
public void | sendNotification(javax.management.Notification notif)Send the Notification. If created with async=true,
then this routine returns immediately and the Notification is sent
on a separate Thread.
if ( getListenerCount() != 0 )
{
if ( getSenderThread() != null )
{
mSenderThread.enqueue( notif );
}
else
{
internalSendNotification( notif );
}
}
|