org.jph.channels.process
Interface ProcessingOutputChannel<Min,Mout>

All Superinterfaces:
OutputChannel<Min>
All Known Implementing Classes:
StdProcessingOutputChannel

public interface ProcessingOutputChannel<Min,Mout>
extends OutputChannel<Min>

The ProcessingOutputChannel is an OutputChannel that processes a message and posts the resulting message on an OutputChannel.

The message is processed with by the Processor. If the Processor returns null, nothing is done (so no message is send to the OutputChannel). If the Processor sends back a message, that message is posted on the following channel. There is no guarantee that the returning msg will be processed. If the following channel doesn`t accept the offer (the put will succeed) the message is dropped. Maybe add a OfferRejectedHandler to give control to deal with this problem?

If an error is encountered while processing the message, the ProcessExceptionHandler is called to deal with the error. (todo:not at the moment)

The Message is processed on the Thread that called the put/offer. With the offer this gives problems because the maximum time between the offer being called on this ProcessingOutputChannel and moment the message succesfully was offered on the target is timeout + processingtime. This is something that has to be thought about (a good solution has to be found).

Author:
Peter Veentjer.

Method Summary
 ProcessExceptionHandler<Min> getExceptionHandler()
          Return the ProcessExceptionHandler this ProcessingOutputChannel uses to deal with errors that occured while processing the message.
 Processor<Min,Mout> getMsgProcessor()
          Returns the Processor this ProcessingOutputChannel uses to process the messages.
 OutputChannel<Mout> getTarget()
          Returns the OutputChannel the resulting message (if it isn`t null) is send to.
 
Methods inherited from interface org.jph.channels.OutputChannel
offer, put
 

Method Detail

getMsgProcessor

Processor<Min,Mout> getMsgProcessor()
Returns the Processor this ProcessingOutputChannel uses to process the messages.


getTarget

OutputChannel<Mout> getTarget()
Returns the OutputChannel the resulting message (if it isn`t null) is send to.


getExceptionHandler

ProcessExceptionHandler<Min> getExceptionHandler()
Return the ProcessExceptionHandler this ProcessingOutputChannel uses to deal with errors that occured while processing the message.



Copyright © 2005 Anchormen. All Rights Reserved.