org.spicefactory.cinnamon.io
Class KeepAliveMessageProcessor

java.lang.Object
  extended by org.spicefactory.cinnamon.io.KeepAliveMessageProcessor
All Implemented Interfaces:
MessageProcessor<KeepAliveMessage,KeepAliveMessage>

public class KeepAliveMessageProcessor
extends Object
implements MessageProcessor<KeepAliveMessage,KeepAliveMessage>

MessageProcessor implementation vor keep-alive messages. This implementation just returns the request object.

Author:
Jens Halm

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.spicefactory.cinnamon.io.MessageProcessor
MessageProcessor.ResultHolder<O>
 
Constructor Summary
KeepAliveMessageProcessor()
           
 
Method Summary
 MessageProcessor.ResultHolder<KeepAliveMessage> processException(KeepAliveMessage request, Exception e)
          Processes the specified Exception and returns a result to be sent to the client.
 MessageProcessor.ResultHolder<KeepAliveMessage> processMessage(KeepAliveMessage request)
          Processes the given request instance and returns a result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeepAliveMessageProcessor

public KeepAliveMessageProcessor()
Method Detail

processMessage

public MessageProcessor.ResultHolder<KeepAliveMessage> processMessage(KeepAliveMessage request)
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<KeepAliveMessage,KeepAliveMessage>
Parameters:
request - the object representing the request
Returns:
a ResultHolder instance containing the result to be sent to the client

processException

public MessageProcessor.ResultHolder<KeepAliveMessage> processException(KeepAliveMessage request,
                                                                        Exception e)
Description copied from interface: MessageProcessor
Processes the specified Exception and returns a result to be sent to the client. When this method gets invoked it is possible that the 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.

Specified by:
processException in interface MessageProcessor<KeepAliveMessage,KeepAliveMessage>
Parameters:
request - the object representing the request
e - the Exception that was thrown before or after processing the specified message
Returns:
a ResultHolder instance containing the result to be sent to the client