Hans Wolffenbuttel [
http://community.jboss.org/people/h.wolffenbuttel] replied to the
discussion
"Annotation based Action classes"
To view the discussion, visit:
http://community.jboss.org/message/539213#539213
--------------------------------------------------------------
Hi Tom,
Does this mean you could have more then one @ProcessMethod with differend parameters where
the kind of payload will activate the right one for the job?
I will illustrate: Say you have differend kinds of orders: orders-send-by-mail,
orders-picked-up-at-location and express-orders. All these orders are converted by
unmarshalling it from XML to Java-objects. Then the actionclass would look like:
public class HandleOrderAction{
@ProcessMethod
public OrderAcknowledgment processOrder(MailOrder purchaseOrder){ // Do your thing
with the order...
return new OrderAcknowledgment(....);
}
@ProcessMethod
public OrderAcknowledgment processOrder(PickupOrder purchaseOrder){ // Do your
thing with the order...
return new OrderAcknowledgment(....);
}
@ProcessMethod
public OrderAcknowledgment processOrder(ExpressOrder purchaseOrder){ // Do your
thing with the order...
return new OrderAcknowledgment(....);
}
}
So when an expressorder is placed, the processmethod will call the method with the
ExpressOrder as incoming parameter, when a mailorder is placed the method will be called
with the MailOrder parameter and so on.
Will this work or is this possible in any way?
regards,
Hans
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/539213#539213]
Start a new discussion in JBoss ESB Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]