org.spicefactory.cinnamon.io
Interface PhaseListener

All Known Implementing Classes:
AbstractPersistenceContextPhaseListener, SpringPersistenceContextPhaseListener

public interface PhaseListener

Low-level extension point that can be used to add functionality to individual phases of request processing. An example would be the PhaseListener implementation used by the Pimento data management framework to wrap the decoding and encoding process with transactions.

Author:
Jens Halm

Method Summary
 void afterDecodingException(Exception ex)
          Invoked if decoding of the incoming AMF request failed.
 void afterEncoding()
          Invoked after encoding of the response has been completed.
 void afterProcessing(Envelope request, Envelope response)
          Invoked after processing of messages has been completed but before encoding of the response has started.
 void beforeDecoding()
          Invoked before decoding of the incoming AMF request starts.
 void beforeProcessing(Envelope request)
          Invoked after decoding of the request has been completed but before processing the decoded messages.
 

Method Detail

beforeDecoding

void beforeDecoding()
Invoked before decoding of the incoming AMF request starts.


afterDecodingException

void afterDecodingException(Exception ex)
Invoked if decoding of the incoming AMF request failed. In this case processing of this request will be stopped. No further methods will be invoked in this listener for this particular request, thus all cleanup tasks should be performed in this method.

Parameters:
ex - the Exception that was caught while decoding the request

beforeProcessing

void beforeProcessing(Envelope request)
Invoked after decoding of the request has been completed but before processing the decoded messages.

Parameters:
request - the Envelope containing all messages that will be processed

afterProcessing

void afterProcessing(Envelope request,
                     Envelope response)
Invoked after processing of messages has been completed but before encoding of the response has started.

Parameters:
request - the Envelope containing all request messages that have been processed
response - the Envelope containing all response messages that will be sent to the client

afterEncoding

void afterEncoding()
Invoked after encoding of the response has been completed.