[jboss-dev-forums] [JBoss ESB Development] - Annotation based Action classes

Tom Fennelly do-not-reply at jboss.com
Thu May 13 02:56:39 EDT 2010


Tom Fennelly [http://community.jboss.org/people/tfennelly] replied to the discussion

"Annotation based Action classes"

To view the discussion, visit: http://community.jboss.org/message/542781#542781

--------------------------------------------------------------
I commited what I have on this to a workspace in SVN:  http://anonsvn.jboss.org/repos/labs/labs/jbossesb/workspace/tfennelly/annotated_components http://anonsvn.jboss.org/repos/labs/labs/jbossesb/workspace/tfennelly/annotated_components

I modified the http_gateway quickstart as one example:
*  http://fisheye.jboss.org/browse/JBossESB/workspace/tfennelly/annotated_components/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java?r=32822 before
*  http://fisheye.jboss.org/browse/JBossESB/workspace/tfennelly/annotated_components/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java?r=32847 after

In it you can see how the @ProcessMethod method is now taking multiple non ESB Message params.  The params are annotated with @BodyParam and @PropertyParam annotations, which tell the ESB from where to extrat those params on the Message before invoking (@AttachmentParam is also there). 

@ProcessMethod
public String printHttpRequestInfo(@BodyParam byte[] httpPayload, @PropertyParam HttpRequest requestInfo )


Those params can also take an explicit named location (e.g. @BodyParam("orderInfo")).  These @XParam annotations are not required.  If not present, the ESB will search the message based on param type, which is convenient but of course has the obvious "risks" that need to be kept in mind.

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/542781#542781]

Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2032]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20100513/7a4b90d5/attachment.html 


More information about the jboss-dev-forums mailing list