Let's see if we can clarify.
Currently, gateways are inbound only. They are supposed to obtain any object (file, JMS
message, etc.), package it as an ESB message, and send it to an EPR where a 'message
aware listener' will pick it up, and pass it to an ActionProcessingPipeline.
Once you are in the pipeline, any outgoing arbitrary object (arbitrary in the sense that
it does not need to be an esb message), can be produced in any (user) action class, either
by the method speficied in the 'process' attribute (default is process(Message)
method), or in the method specified in the (optional) 'okMethod ' property for
normal completion, or in the method specified in the (also optional)
'exceptionMethod' property
A generic example of how to do this is:
| <actions>
| <action name="outboundObject"
class="mypackage.MyClass" process="step1, step2,step3">
| <property name="okMethod"
value="mySuccessMethod" />
| <property name="exceptionMethod"
value="myFailureMethod" />
| </action>
| </actions>
|
This example has only one action class in the pipeline, but it invokes three methods in
sequence: step1, step2 and step3. Signature of these three is Message stepX(Message)
throws Exception
If the 'process' attribute were not included, the default is to invoke the
Message process(Message) method in the action class.
If at any point, the sequence of steps throws an Exception, and the property with name
'exceptionMethod' was specified (as in our example), then the corresponding method
will be invoked (signature: void xxxxx(Message, Throwable))
If the sequence runs successfully (no Exceptions thrown), and the property with name
'okMethod' was specified (as in our example), then the corresponding method will
be invoked (signature void zzzzz(Message))
An 'outbound gateway' can be implemented simply by implementing methods for
success and failure with the proper signatures, and specify them in the 'okMethod'
and 'exceptionMethod' properties of the action class.
I hope this helps.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029382#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...