public interface NotificationHandlerRegistration
PathAddress
.
The source PathAddress can be a pattern if at least one of its element value is a wildcard (PathElement.getValue()
is *
).
For example:
/subsystem=messaging/hornetq-server=default/jms-queue=*
is an address pattern./subsystem=messaging/hornetq-server=*/jms-queue=*
is an address pattern./subsystem=messaging/hornetq-server=default/jms-queue=myQueue
is not an address pattern.Modifier and Type | Interface and Description |
---|---|
static class |
NotificationHandlerRegistration.Factory
Factory to create a new
NotificationHandlerRegistration |
Modifier and Type | Field and Description |
---|---|
static PathAddress |
ANY_ADDRESS
Special path address to register a notification handler for any source.
|
Modifier and Type | Method and Description |
---|---|
Collection<NotificationHandler> |
findMatchingNotificationHandlers(Notification notification)
Return all the
NotificationHandler that where registered to listen to the notification's source address (either directly
or though pattern addresses) after filtering them out using the NotificationFilter given at registration time. |
void |
registerNotificationHandler(PathAddress source,
NotificationHandler handler,
NotificationFilter filter)
Register the given NotificationHandler to receive notifications emitted by the resource at the given source address.
|
void |
unregisterNotificationHandler(PathAddress source,
NotificationHandler handler,
NotificationFilter filter)
Unregister the given NotificationHandler to stop receiving notifications emitted by the resource at the given source address.
|
static final PathAddress ANY_ADDRESS
NotificationFilter
to constrain the received notifications (e.g. by their types).void registerNotificationHandler(PathAddress source, NotificationHandler handler, NotificationFilter filter)
NotificationHandler.handleNotification(org.jboss.as.controller.notification.Notification)
method will only be called on the registered handler if the filter's NotificationFilter.isNotificationEnabled(org.jboss.as.controller.notification.Notification)
returns true
for the given notification.
source
- the path address of the resource that emit notifications.handler
- the notification handlerfilter
- the notification filter. Use NotificationFilter.ALL
to let the handler always handle notificationsvoid unregisterNotificationHandler(PathAddress source, NotificationHandler handler, NotificationFilter filter)
source
- the path address of the resource that emit notifications.handler
- the notification handlerfilter
- the notification filterCollection<NotificationHandler> findMatchingNotificationHandlers(Notification notification)
NotificationHandler
that where registered to listen to the notification's source address (either directly
or though pattern addresses) after filtering them out using the NotificationFilter
given at registration time.notification
- the source address of the notification must be a concrete address correspdonding to a resource
(and not a wildcard address)NotificationHandler
that registered against the notification source.Copyright © 2023 JBoss by Red Hat. All rights reserved.