org.spicefactory.pimento.io
Class PimentoMessageProcessor
java.lang.Object
org.spicefactory.cinnamon.service.ServiceMessageProcessor
org.spicefactory.pimento.io.PimentoMessageProcessor
- All Implemented Interfaces:
- MessageProcessor<ServiceRequest,ServiceResponse>
public class PimentoMessageProcessor
- extends ServiceMessageProcessor
Cinnamon ServiceMessageProcessor that processes all requests managed by Pimento.
Replaces Cinnamon's builtin ServiceMessageProcessor.
- Author:
- Jens Halm
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PimentoMessageProcessor
public PimentoMessageProcessor(PimentoConfig config)
- Creates a new instance.
- Parameters:
config - the Pimento configuration to apply
processMessage
public MessageProcessor.ResultHolder<ServiceResponse> processMessage(ServiceRequest message)
- Description copied from interface:
MessageProcessor
- Processes the given request instance and returns a result. The returned ResultHolder
instance holds the actual result instance and a boolean property indicating whether
the result represents an error outcome. A message processor may also decide to throw
an Exception instead of returning a result representing an error. In this case fail fast
behaviour will be applied: The processing of subsequent messages in the same request will
be prevented and all messages that were already processed will be reprocessed with the
processException method. This may be useful if some kind of transactional
behaviour needs to be applied to a batch of method invocations.
- Specified by:
processMessage in interface MessageProcessor<ServiceRequest,ServiceResponse>- Overrides:
processMessage in class ServiceMessageProcessor
- Parameters:
message - the object representing the request
- Returns:
- a ResultHolder instance containing the result to be sent to the client
logRequest
protected void logRequest(ServiceRequest request)
- Overrides:
logRequest in class ServiceMessageProcessor
logResult
protected void logResult(ServiceRequest request,
ServiceResponse response)
- Overrides:
logResult in class ServiceMessageProcessor