Vordel SDK

com.vordel.circuit
Interface MessageListener

All Known Implementing Classes:
FilterPathTracker, MessageListenerAdapter

public interface MessageListener


Method Summary
 void abortedCircuitInvocation(Circuit circuit, Message message, CircuitAbortException reason)
          Called if the Circuit exits because of a fault with one of the Filters therein.
 void onMessageCompletion(Message message)
          Called when a Message has fully exited the system.
 void postCircuitInvocation(Circuit circuit, Message message, boolean result, java.lang.Object context)
          Called after a chain of Filters in the Circuit has been invoked.
 void postCircuitProcessing(Message message, int result)
          Called when all processing in the Circuit-space is completed.
 void postFilterInvocation(Circuit circuit, MessageProcessor processor, Message message, int resultType, MessageProcessor caller, java.lang.Object context)
          This method is called when a Filter's MessageProcessor has finished execution.
 void preCircuitInvocation(Circuit circuit, Message message, java.lang.Object context)
          Called before the first Filter in a given Circuit is invoked.
 void preCircuitProcessing(Circuit circuit, Message message, java.lang.Object context)
          Called when the message originator has completed initializing the Message, and we are about to start processing in the Circuit-space.
 void preFaultHandlerInvocation(Circuit circuit, MessageProcessor faultHandler, Message message, CircuitAbortException reason)
          Called before attempting to handle a previous CircuitAbortException with a specific fault-handling MessageProcessor.
 void preFilterInvocation(Circuit circuit, MessageProcessor processor, Message message, MessageProcessor caller, java.lang.Object context)
          This method is called immediately before a Filter's MessageProcessor is invoked.
 

Method Detail

preCircuitProcessing

void preCircuitProcessing(Circuit circuit,
                          Message message,
                          java.lang.Object context)
Called when the message originator has completed initializing the Message, and we are about to start processing in the Circuit-space.

Parameters:
circuit - The Circuit which is about to be invoked.
message - The Message.
context - The Message originator, or null.

postCircuitProcessing

void postCircuitProcessing(Message message,
                           int result)
Called when all processing in the Circuit-space is completed.

Parameters:
message - The Message.
result - The result of Circuit processing. One of:

preCircuitInvocation

void preCircuitInvocation(Circuit circuit,
                          Message message,
                          java.lang.Object context)
Called before the first Filter in a given Circuit is invoked.

Parameters:
circuit - The Circuit about to be called.
message - The Message.
context - The context in which this circuit was called. In the case of the circuit being run via a reference from a filter, it may be null, an ESPK, or a String property which resolves to this circuit. In the case of the circuit being run from the Transport module, it will be that module itself (as per the 'source' parameter in Message.addCreationListener(com.vordel.circuit.MessageCreationListener)), or null if no source was specified to the creation callback.

postCircuitInvocation

void postCircuitInvocation(Circuit circuit,
                           Message message,
                           boolean result,
                           java.lang.Object context)
Called after a chain of Filters in the Circuit has been invoked.

Parameters:
circuit - The Circuit.
message - The Message.
result - The status which the Circuit returned - True if the Circuit passed, False if it failed. If it aborted, the abortedCircuitInvocation(com.vordel.circuit.Circuit, com.vordel.circuit.Message, com.vordel.circuit.CircuitAbortException) method is called instead.

abortedCircuitInvocation

void abortedCircuitInvocation(Circuit circuit,
                              Message message,
                              CircuitAbortException reason)
Called if the Circuit exits because of a fault with one of the Filters therein.

Parameters:
circuit - The Circuit which threw the CircuitAbortException.
message - The Message.
reason - The reason for the Circuit aborting. Usually the result of a specific Filter aborting, but may also be the result of a circuit configuration issue (e.g. no start filter).

preFaultHandlerInvocation

void preFaultHandlerInvocation(Circuit circuit,
                               MessageProcessor faultHandler,
                               Message message,
                               CircuitAbortException reason)
Called before attempting to handle a previous CircuitAbortException with a specific fault-handling MessageProcessor.

Parameters:
circuit - The Circuit in whose context the faultHander will execute.
message - The Message.
faultHandler - The fault handler MessageProcessor we're about to invoke.
reason - The CircuitAbortException which brought us here.

preFilterInvocation

void preFilterInvocation(Circuit circuit,
                         MessageProcessor processor,
                         Message message,
                         MessageProcessor caller,
                         java.lang.Object context)
This method is called immediately before a Filter's MessageProcessor is invoked.

Parameters:
circuit - The Circuit context in which this processor was called.
processor - The MessageProcessor about to be invoked.
message - The Message before the processor works on it.
caller - The MessageProcessor which is calling this processor. Usually this is null, as the Circuit is the implicit caller of the processor. However, some processors are compound processors, i.e. they are themselves made up of other processors. In these cases, it's the caller processor which invokes the 'mp' in the context of the caller's Circuit. When this happens, the 'caller' parameter will be non-null.

postFilterInvocation

void postFilterInvocation(Circuit circuit,
                          MessageProcessor processor,
                          Message message,
                          int resultType,
                          MessageProcessor caller,
                          java.lang.Object context)
This method is called when a Filter's MessageProcessor has finished execution.

Parameters:
circuit - The Circuit context in which this processor was called.
processor - The MessageProcessor which was invoked.
message - The Message as populated after invocation.
resultType - one of
caller - The MessageProcessor which called this processor. Usually this is null. See preFilterInvocation(com.vordel.circuit.Circuit, com.vordel.circuit.MessageProcessor, com.vordel.circuit.Message, com.vordel.circuit.MessageProcessor, java.lang.Object).

onMessageCompletion

void onMessageCompletion(Message message)
Called when a Message has fully exited the system.

Parameters:
message -

Vordel SDK


This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel