javax.management
Class NotificationFilterSupport

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

public class NotificationFilterSupport
extends java.lang.Object
implements NotificationFilter (src) , java.io.Serializable

An implementation of the NotificationFilter (src) interface.

It filters on the notification type. It Maintains a list of enabled notification types. By default no notifications are enabled.

The enabled types are prefixes. That is a notification is enabled if it starts with an enabled string.

See Also:
Serialized Form

Constructor Summary
NotificationFilterSupport()
          Create a filter that filters out all notification types.
 
Method Summary
 void disableAllTypes()
          Disable all notification types.
 void disableType(java.lang.String type)
          Disable a notification type.
 void enableType(java.lang.String type)
          Enable a notification type.
 java.util.Vector getEnabledTypes()
          Get all the enabled notification types.
 boolean isNotificationEnabled(Notification (src)  notification)
          Test to see whether this notification is enabled
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotificationFilterSupport

public NotificationFilterSupport()
Create a filter that filters out all notification types.

Method Detail

disableAllTypes

public void disableAllTypes()
Disable all notification types. Rejects all notifications.


disableType

public void disableType(java.lang.String type)
Disable a notification type.

Parameters:
type - the notification type to disable.

enableType

public void enableType(java.lang.String type)
                throws java.lang.IllegalArgumentException
Enable a notification type.

Parameters:
type - the notification type to enable.
Throws:
java.lang.IllegalArgumentException - for a null type

getEnabledTypes

public java.util.Vector getEnabledTypes()
Get all the enabled notification types.

Returns a vector of enabled notification type.
An empty vector means all types disabled.

Returns:
the vector of enabled types.

toString

public java.lang.String toString()
Returns:
human readable string.

isNotificationEnabled

public boolean isNotificationEnabled(Notification (src)  notification)
Test to see whether this notification is enabled

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