javax.management.relation
Class MBeanServerNotificationFilter

java.lang.Object
  extended byjavax.management.NotificationFilterSupport (src) 
      extended byjavax.management.relation.MBeanServerNotificationFilter
All Implemented Interfaces:
NotificationFilter (src) , java.io.Serializable

public class MBeanServerNotificationFilter
extends NotificationFilterSupport (src)

A helper class, used to filter notifications of registration, unregistration of selected object names.

See Also:
Serialized Form

Constructor Summary
MBeanServerNotificationFilter()
          Create a filter selecting nothing by default
 
Method Summary
 void disableAllObjectNames()
          Disable all object names.
 void disableObjectName(ObjectName (src)  objectName)
          Disable an object name.
 void enableAllObjectNames()
          Enable all object names.
 void enableObjectName(ObjectName (src)  objectName)
          Enable an object name.
 java.util.Vector getDisabledObjectNames()
          Get all the disabled object names.
 java.util.Vector getEnabledObjectNames()
          Get all the enabled object names.
 boolean isNotificationEnabled(Notification (src)  notification)
          Test to see whether this notification is enabled
 java.lang.String toString()
           
 
Methods inherited from class javax.management.NotificationFilterSupport (src)
disableAllTypes, disableType, enableType, getEnabledTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MBeanServerNotificationFilter

public MBeanServerNotificationFilter()
Create a filter selecting nothing by default

WARNING!! WARNING!! The spec says the MBeanServerNotificationFilter accepts everything by default. The RI does exactly the opposite. I follow the RI.

Method Detail

disableAllObjectNames

public void disableAllObjectNames()
Disable all object names. Rejects all notifications.


disableObjectName

public void disableObjectName(ObjectName (src)  objectName)
                       throws java.lang.IllegalArgumentException
Disable an object name.

Parameters:
objectName - the object name to disable.
Throws:
java.lang.IllegalArgumentException - for a null object name

enableAllObjectNames

public void enableAllObjectNames()
Enable all object names. Accepts all notifications.


enableObjectName

public void enableObjectName(ObjectName (src)  objectName)
                      throws java.lang.IllegalArgumentException
Enable an object name.

Parameters:
objectName - the object name to enable.
Throws:
java.lang.IllegalArgumentException - for a null object name

getDisabledObjectNames

public java.util.Vector getDisabledObjectNames()
Get all the disabled object names.

Returns a vector of disabled object names.
Null for all object names disabled. An empty vector means all object names enabled.

Returns:
the vector of disabled object names.

getEnabledObjectNames

public java.util.Vector getEnabledObjectNames()
Get all the enabled object names.

Returns a vector of enabled object names.
Null for all object names enabled. An empty vector means all object names disabled.

Returns:
the vector of enabled object names.

toString

public java.lang.String toString()
Overrides:
toString in class NotificationFilterSupport (src)
Returns:
human readable string.

isNotificationEnabled

public boolean isNotificationEnabled(Notification (src)  notification)
                              throws java.lang.IllegalArgumentException
Test to see whether this notification is enabled

Specified by:
isNotificationEnabled in interface NotificationFilter (src)
Overrides:
isNotificationEnabled in class NotificationFilterSupport (src)
Parameters:
notification - the notification to filter
Returns:
true when the notification should be sent, false otherwise
Throws:
java.lang.IllegalArgumentException - for null notification.