Methods Summary |
---|
private javax.management.NotificationFilter | _getFilter(javax.management.ObjectName objectName)
final NotificationFilter filter =
(NotificationFilter)mListenees.get( objectName );
return( filter );
|
private void | checkListeningTo(javax.management.ObjectName objectName)
if ( ! mListenees.containsKey( objectName ) )
{
throw new IllegalArgumentException( objectName.toString() );
}
|
public java.lang.Object | createBuffer(int bufferSize, javax.management.NotificationFilter filter)
final OverflowHandler handler = new OverflowHandlerImpl();
final NotificationBuffer buffer =
new NotificationBuffer( bufferSize, filter, handler );
Object id = null;
synchronized( mBuffers )
{
++sBufferID;
id = "" + sBufferID;
mBuffers.put( id, buffer );
}
return( id );
|
public void | dontListenTo(javax.management.ObjectName pattern)
mIncludePatterns.remove( pattern );
final Set<ObjectName> listenees = getMatchingObjectNames( pattern );
final MBeanServer server = getMBeanServer();
for( final ObjectName objectName : listenees )
{
try
{
server.removeNotificationListener( objectName, this );
mListenees.remove( objectName );
}
catch( ListenerNotFoundException e )
{
}
catch( InstanceNotFoundException e )
{
}
}
|
private NotificationBuffer | getBuffer(java.lang.Object bufferID)
return( (NotificationBuffer)mBuffers.get( bufferID ) );
|
public java.util.Map | getBufferNotifications(java.lang.Object bufferID, long sequenceNumberIn)
final NotificationBuffer buffer = getBuffer( bufferID );
return( buffer.getNotifications( sequenceNumberIn ) );
|
public javax.management.NotificationFilter | getFilter(javax.management.ObjectName objectName)
checkListeningTo( objectName );
return( _getFilter( objectName ) );
|
public java.lang.String | getGroup()
return( AMX.GROUP_UTILITY );
|
public java.util.Set | getListeneeObjectNameSet()
final Set<ObjectName> objectNames = new HashSet<ObjectName>();
synchronized( mListenees )
{
objectNames.addAll( mListenees.keySet() );
}
return( objectNames );
|
protected java.util.Set | getMatchingObjectNames(javax.management.ObjectName pattern)
Set<ObjectName> s = null;
if ( pattern.isPattern() )
{
s = JMXUtil.queryNames( getMBeanServer(), pattern, null );
}
else
{
s = GSetUtil.newSingletonSet( pattern );
}
return( s );
|
public javax.management.MBeanNotificationInfo[] | getNotificationInfo()
final MBeanNotificationInfo info = new MBeanNotificationInfo(
NOTIF_TYPES,
Notification.class.getName(),
"" );
final MBeanNotificationInfo[] selfInfos = new MBeanNotificationInfo[] { info };
return( JMXUtil.mergeMBeanNotificationInfos( super.getNotificationInfo(), selfInfos ) );
|
public final java.lang.Object | getUserData()
return( mUserData );
|
public void | handleNotification(javax.management.Notification notif, java.lang.Object handback)
synchronized( mBuffers )
{
for( final Object id : mBuffers.keySet() )
{
getBuffer( id ).bufferNotification( notif );
}
}
// let all listeners know...
sendNotification( notif );
|
protected void | issueBufferOverflowNotification(javax.management.Notification oldNotif)
if ( shouldEmitNotifications() )
{
sendNotification( NotificationService.BUFFER_OVERFLOW_NOTIFICATION_TYPE,
NotificationService.OVERFLOWED_NOTIFICATION_KEY,
oldNotif );
}
|
public void | listenTo(javax.management.ObjectName pattern, javax.management.NotificationFilter filter)
mIncludePatterns.put( pattern, filter );
final Set<ObjectName> listenees = getMatchingObjectNames( pattern );
final MBeanServer server = getMBeanServer();
for( final ObjectName objectName : listenees )
{
if ( objectName.equals( getObjectName() ) )
{
continue;
}
listenToSingle( objectName, filter );
}
|
protected void | listenToIfMatch(javax.management.ObjectName objectName)
if ( ! mListenees.keySet().contains( objectName ) )
{
final String defaultDomain = getMBeanServer().getDefaultDomain();
for( final ObjectName pattern : mIncludePatterns.keySet() )
{
if ( JMXUtil.matchesPattern( defaultDomain, pattern, objectName ) )
{
final NotificationFilter filter =
(NotificationFilter)mIncludePatterns.get( pattern );
listenToSingle( objectName, filter );
}
}
}
|
protected void | listenToSingle(javax.management.ObjectName objectName, javax.management.NotificationFilter filter)
mListenees.put( objectName, filter );
try
{
getMBeanServer().addNotificationListener( objectName, this, filter, null );
}
catch( Exception e )
{
mListenees.remove( objectName );
}
|
public void | preDeregisterHook()
super.preDeregisterHook();
synchronized( mListenees )
{
final Set<ObjectName> s = getListeneeObjectNameSet();
final ObjectName[] objectNames = new ObjectName[ s.size() ];
s.toArray( objectNames );
for( int i = 0; i < objectNames.length; ++i )
{
dontListenTo( objectNames[ i ] );
}
}
synchronized( mBuffers )
{
for( final NotificationBuffer buffer : mBuffers.values() )
{
removeBuffer( buffer );
}
}
|
protected void | preRegisterDone()
super.preRegisterDone();
// it's crucial we listen for registration/unregistration events
// so that any patterns are maintained.
JMXUtil.listenToMBeanServerDelegate( getMBeanServer(),
new RegistrationListener(), null, null );
|
public void | removeBuffer(java.lang.Object bufferID)
final NotificationBuffer buffer =
(NotificationBuffer)mBuffers.remove( bufferID );
|