javax.management.NotificationFilter interface.
The filtering is performed on the notification type attribute.
Manages a list of enabled notification types. A method allows users to enable/disable as many notification types as required.
Then, before sending a notification to a listener registered with a filter, the notification broadcaster compares this notification type with all notification types enabled by the filter. The notification will be sent to the listener only if its filter enables this notification type.
Example:
NotificationFilterSupport myFilter = new NotificationFilterSupport();
myFilter.enableType("my_example.my_type");
myBroadcaster.addListener(myListener, myFilter, null);
The listener myListener will only receive notifications the type of which equals/starts with "my_example.my_type".
javax.management.NotificationBroadcaster#addNotificationListener
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| public synchronized void | |
| public synchronized void | enableType(String
The prefix. prefix)Enables all the notifications the type of which starts with the specified prefix to be sent to the listener. |
| public synchronized Vector | Returns: The list containing all the enabled notification types.Gets all the enabled notification types for this filter. |
| public synchronized boolean | Returns: true if the notification should be sent to the listener, false otherwise.The notification to be sent. notification)Implements javax. Invoked before sending the specified notification to the listener. |
| enabledTypes | back to summary |
|---|---|
private List<String> enabledTypes
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| NotificationFilterSupport | back to summary |
|---|---|
| public NotificationFilterSupport() Constructs a | |
| disableAllTypes | back to summary |
|---|---|
| public synchronized void disableAllTypes() Disables all notification types. | |
| disableType | back to summary |
|---|---|
| public synchronized void disableType(String prefix) Removes the given prefix from the prefix list.
| |
| enableType | back to summary |
|---|---|
| public synchronized void enableType(String prefix) throws IllegalArgumentException Enables all the notifications the type of which starts with the specified prefix
to be sent to the listener.
Example:
Note that:
will no match any notification type.
| |
| getEnabledTypes | back to summary |
|---|---|
| public synchronized Vector Gets all the enabled notification types for this filter. | |
| isNotificationEnabled | back to summary |
|---|---|
| public synchronized boolean isNotificationEnabled(Notification notification) Implements javax. Invoked before sending the specified notification to the listener.
| |