Constructor and Description |
---|
TraceableDelegatingRouter(Router delegate) |
Modifier and Type | Method and Description |
---|---|
<E extends Event<?>> |
route(Object key,
E event,
List<Registration<Object,? extends Consumer<? extends Event<?>>>> consumers,
Consumer<E> completionConsumer,
Consumer<Throwable> errorConsumer)
Routes the
event , triggered by a notification with the given key to the
consumers . |
public TraceableDelegatingRouter(Router delegate)
public <E extends Event<?>> void route(Object key, E event, List<Registration<Object,? extends Consumer<? extends Event<?>>>> consumers, Consumer<E> completionConsumer, Consumer<Throwable> errorConsumer)
Router
event
, triggered by a notification with the given key
to the
consumers
. Depending on the router implementation, zero or more of the consumers
will receive the event. Upon successful completion of the event routing, the
completionConsumer
will be invoked. completionConsumer
may be null. In the
event of an exception during routing the errorConsumer
is invoked.
errorConsumer
may be null, in which case the exception is swallowed.route
in interface Router
key
- The notification keyevent
- The Object
to routeconsumers
- The Consumer
s to route the event to.completionConsumer
- The Consumer
to invoke upon successful completion of event routingerrorConsumer
- The Consumer
to invoke when an error occurs during event routingCopyright © 2016. All rights reserved.