public interface MessageDispatchRegistry
The current implementation of this interface (MessageDispatchSender
)
does not interpret the message type polymorphicly. That is, a message is only
passed to a handler if the handler was registered for the message's class;
handlers registered for super classes are not invoked.
Modifier and Type | Interface and Description |
---|---|
static class |
MessageDispatchRegistry.AbstractBlockingHandler<T extends Message>
Most handlers ignore the shutdown event, so provide this as a convenient
base for anonymous classes.
|
static class |
MessageDispatchRegistry.AbstractHandler<T extends Message>
Most handlers ignore the shutdown event, so provide this as a convenient
base for anonymous classes.
|
static interface |
MessageDispatchRegistry.BlockingHandler<T extends Message>
Handler interface.
|
static interface |
MessageDispatchRegistry.Handler<T extends Message>
Handler interface.
|
Modifier and Type | Method and Description |
---|---|
void |
addFallback(MessageDispatchRegistry.Handler<Message> messageHandler)
Register a message handler that is called if no other handler or responder
is registered for the message type.
|
<T extends Message,S extends T> |
set(Class<S> messageType,
MessageDispatchRegistry.BlockingHandler<T> responder)
Register a message responder.
|
<T extends Message,S extends T> |
set(Class<S> messageType,
MessageDispatchRegistry.Handler<T> messageHandler)
Register a message handler.
|
<T extends Message,S extends T> MessageDispatchRegistry.Handler<T> set(Class<S> messageType, MessageDispatchRegistry.Handler<T> messageHandler)
S
- Class of messageType.T
- Constrains messageHandler to be able to handle messageType.messageType
- Messages of this type will be routed to the handler.messageHandler
- The message handler.messageType
or null
.<T extends Message,S extends T> MessageDispatchRegistry.BlockingHandler<T> set(Class<S> messageType, MessageDispatchRegistry.BlockingHandler<T> responder)
S
- Class of messageType.T
- Constrains messageHandler to be able to handle messageType.messageType
- Messages of this type will be routed to the handler.responder
- The message responder.messageType
or null
.void addFallback(MessageDispatchRegistry.Handler<Message> messageHandler)
messageHandler
- The sender.Copyright © 2000-2014. All Rights Reserved.