public interface MessageHandler<I,O,R>
There are two types of message handlers implemented by the service - local or remote. Local handlers are those that operate purely on state local to the service i.e. they operate purely on the service's in-memory repository. Remote handlers are effectively proxies to long-running back-end methods and do not use and update local service state.
A message handler reports its type via the getType() and accepts
messages for processing via the handle(java.lang.String, I, O, R) method.
| Modifier and Type | Interface and Description |
|---|---|
static class |
MessageHandler.Type
Enumerates the handler types
|
| Modifier and Type | Method and Description |
|---|---|
MessageHandler.Type |
getType()
Return the type of a handler.
|
MessageView |
handle(String origin,
I message,
O response,
R repository)
The message handler.
|
MessageHandler.Type getType()
MessageView handle(String origin, I message, O response, R repository) throws Exception
origin - The message origin (client)message - The message to handle.response - The message's response message. Non-null only for
request messages.repository - The service repository. Non-null only for local handlers.ExceptionCopyright © 2016 Neeve Research, LLC. All Rights Reserved.