|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MessageProcessor<I,O>
A MessageProcessor implementation is responsible for processing the request object and returning
a result instance. Implementations should be stateless since they will be reused for multiple requests.
The two type parameters represent the classes used for the request and the response message respectively.
Cinnamon comes with two default implementations which will be added automatically to the configuration:
ServiceRequestMessageProcessor and KeepAliveMessageProcessor. The former
is repsonsible for processing regular service invocation requests while the latter handles simple
keep-alive messages sent from a client-side ServiceChannel. You can replace the default implementations
with custom implementations or create completely new message types and their corresponding handlers.
In the latter case you'd have to use a custom ServiceInvocationHandler on the client side that
produces the new message type.
| Nested Class Summary | |
|---|---|
static class |
MessageProcessor.ResultHolder<O>
Represents a single result produced by a MessageProcessor. |
| Method Summary | |
|---|---|
MessageProcessor.ResultHolder<O> |
processException(I request,
Exception e)
Processes the specified Exception and returns a result to be sent to the client. |
MessageProcessor.ResultHolder<O> |
processMessage(I request)
Processes the given request instance and returns a result. |
| Method Detail |
|---|
MessageProcessor.ResultHolder<O> processMessage(I request)
processException method. This may be useful if some kind of transactional
behaviour needs to be applied to a batch of method invocations.
request - the object representing the request
MessageProcessor.ResultHolder<O> processException(I request,
Exception e)
processMessage method
has already been invoked for the same request message. This method will be invoked when
an Exception occured before or after processing the message (probably in a PhaseListener
method. In this case a corresponding message should be returned to the client even if the
original message processing succeeded.
request - the object representing the requeste - the Exception that was thrown before or after processing the specified message
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||