javax.management
public class NotificationFilterSupport extends Object implements NotificationFilter
Notification
s
based on a list of type prefixes. The type of a notification
is compared with each member of the list using
String.startsWith(String)
and, if one matches,
the notification is allowed to pass through the filter.
Matching on the beginning of the string is used in
preference to wildcards, so type.*
will
match only notifications with a type beginning with
code>type.*, not type.
as
expected.Constructor and Description |
---|
NotificationFilterSupport() |
Modifier and Type | Method and Description |
---|---|
void |
disableAllTypes()
Blocks all types by emptying the list of enabled attributes.
|
void |
disableType(String prefix)
Removes the specified type prefix from the list
of enabled types, thus preventing matching types
from passing through the filter.
|
void |
enableType(String prefix)
Adds the specified type prefix to the list
of enabled types, thus allowing
types starting with this string to pass through
the filter.
|
Vector<String> |
getEnabledTypes()
Returns the list of enabled types for this
filter.
|
boolean |
isNotificationEnabled(Notification notif)
Returns true if the type of the specified notification
begins with one of the enabled type prefixes.
|
public NotificationFilterSupport()
public void disableAllTypes()
public void disableType(String prefix)
prefix
- the prefix to disable.public void enableType(String prefix)
prefix
- the prefix to enable.IllegalArgumentException
- if prefix
is null
.public Vector<String> getEnabledTypes()
public boolean isNotificationEnabled(Notification notif)
isNotificationEnabled
in interface NotificationFilter
notif
- the notification being filtered.