Re: [jboss-dev-forums] [JBoss ESB Development] - Annotation based Action classes
by Keith Babo
Keith Babo [http://community.jboss.org/people/kcbabo] replied to the discussion
"Annotation based Action classes"
To view the discussion, visit: http://community.jboss.org/message/548739#548739
--------------------------------------------------------------
Argh! Brain fart on my end. Completely spaced the fact that the action class is directly referenced in the service definition.
>
> Re adding the @Action annotation... we can do this, but there's no "need" for it at the moment. The annotated actions currently work without a Type level annotation and also without implementing/extending any interfaces/classes. An example of the most basic action...
> *public* *class* MyAction {
> @ProcessMethod
> *public* *void* processOrder(Order order) { //..... }}
I'm all for cute, but sometimes you can get too cute. ;-) Personally, I like the clarity that the annotation provides. It saves us an extra conditional in the parsing, but more importantly it makes it very clear to the action developer (and subsequent maintainer) what's going on.
> So... what currently marks this as an action is the @ProcessMethod annotation (to be renamed) on the processOrder method. I toyed with adding an @Action annotation but it seemed a bit redundant until such time as we support some type level annotation data. In fact... we could drop the requirement of having to have the @ProcessMethod in situations where the action only has a single method e.g....
>
> *public* *class* MyAction {
> *public* *void* processOrder(Order order) { //..... }}
>
>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548739#548739]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 4 months
Re: [jboss-dev-forums] [JBoss ESB Development] - Annotation based Action classes
by Tom Fennelly
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/548731#548731
--------------------------------------------------------------
Thatnks Keith.
I'll pull together a wiki page next.
On removing the word "Method" from some of those annotations... sure. It does look a bit odd. Not sure why I did that actually :)
Re adding the @Action annotation... we can do this, but there's no "need" for it at the moment. The annotated actions currently work without a Type level annotation and also without implementing/extending any interfaces/classes. An example of the most basic action...
public class MyAction {
@ProcessMethod
public void processOrder(Order order) {
//.....
}
}
So... what currently marks this as an action is the @ProcessMethod annotation (to be renamed) on the processOrder method. I toyed with adding an @Action annotation but it seemed a bit redundant until such time as we support some type level annotation data. In fact... we could drop the requirement of having to have the @ProcessMethod in situations where the action only has a single method e.g....
public class MyAction {
public void processOrder(Order order) { //.....
}
}
On @BodyParam and @PropertyParam... yep... you need to pay extra for those and my paypal account is..... :) Sorry about that... I forogt to commit them... they're in there now.
On the process method arg naming annotation(s).... I agree, using those for examples is clearer for sure.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548731#548731]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 4 months
[JBoss Transactions Development] - Regression on setRollbackOnly
by Carlo de Wolf
Carlo de Wolf [http://community.jboss.org/people/wolfc] created the discussion
"Regression on setRollbackOnly"
To view the discussion, visit: http://community.jboss.org/message/548668#548668
--------------------------------------------------------------
With the introduction of https://jira.jboss.org/browse/JBTM-234 https://jira.jboss.org/browse/JBTM-234 we see regression on EJB 3 testsuites when setRollbackOnly is called from afterCompletion. We expect to get an IllegalStateException, instead a SystemException is thrown.
As the issue states OTS raises Inactive:
> +OTS 1.4 2.6.14 rollback_only+
> The transaction associated with the target object is modified so that the only possible
> outcome is to rollback the transaction. The *Inactive* exception is raised if the
> transaction has already been prepared.
While the JTA spec doesn't explicitly account for such a scenario.
To recount:
> void *beforeCompletion*()
>
> The beforeCompletion method is called by the transaction manager prior to the start of the two-phase transaction commit process. This call is executed with the transaction context of the transaction that is being committed.
>
>
> void *afterCompletion*(int status)
>
> This method is called by the transaction manager after the transaction is committed or rolled back.
>
And
> The aftercompletion callback will be invoked in an undefined context.
> void *setRollbackOnly*() throws java.lang.IllegalStateException, http://download.oracle.com/docs/cd/E17410_01/javaee/6/api/javax/transacti... SystemException
> IllegalStateException - Thrown if the target object is not associated with any transaction.
> SystemException - Thrown if the transaction manager encounters an unexpected error condition.
Now it really becomes a choice which exception should be thrown.
> public class *SystemException* extends java.lang.Exception
>
> The SystemException is thrown by the transaction manager to indicate that it has encountered an unexpected error condition that prevents future transaction services from proceeding.
In principal both the state of the transaction and transaction services are not compromised and transaction services proceeds in a defined manner. The outcome of the transaction is the status as passed into the afterCompletion.
Based on the description in SystemException I would say that TS should *not* throw that exception, but instead the IllegalStateException.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548668#548668]
Start a new discussion in JBoss Transactions Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 4 months