You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org> on 2011/04/04 08:38:05 UTC

[jira] [Created] (ARIES-628) Support JTA attributes by annotations

Support JTA attributes by annotations
-------------------------------------

                 Key: ARIES-628
                 URL: https://issues.apache.org/jira/browse/ARIES-628
             Project: Aries
          Issue Type: New Feature
          Components: Transaction
            Reporter: Jean-Baptiste Onofré


currently, we can use a Blueprint descriptor to define the transaction attribute associated to methods:

<bean id="myPojo" class="myPojo" init-method="init">
  <tx:transaction method="set*" value="Required"/>
  <tx:transaction method="get*" value="Supported"/>
</bean>

I think it could be interesting for the users to define transaction attributes directly in the POJO using annotations.

For instance, it could be helpful to support the following annotations:
@PostConstruct
@PreDestroy
@Resource
@TransactionAttribute

For instance, myPojo will look like:

public class MyPojo {

  @TransactionAttribute=Required
  public void setData(Data data) {
    ...
  }

} 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (ARIES-628) Support JTA attributes by annotations

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13015289#comment-13015289 ] 

Jean-Baptiste Onofré commented on ARIES-628:
--------------------------------------------

Graham's comment:

Lin Sun did some
prototyping of Blueprint annotations in the blueprint module (see the
projects with "annotation" in their name.  I believe the design tried
to replicate annotations matching the XML (e.g. an annotation per
element).  It would be good to progress that activity for the things
like @PostConstruct (there are Init and Destroy annotations), etc. and
have the Transaction annotation follow a consistent design approach.


> Support JTA attributes by annotations
> -------------------------------------
>
>                 Key: ARIES-628
>                 URL: https://issues.apache.org/jira/browse/ARIES-628
>             Project: Aries
>          Issue Type: New Feature
>          Components: Transaction
>            Reporter: Jean-Baptiste Onofré
>
> currently, we can use a Blueprint descriptor to define the transaction attribute associated to methods:
> <bean id="myPojo" class="myPojo" init-method="init">
>   <tx:transaction method="set*" value="Required"/>
>   <tx:transaction method="get*" value="Supported"/>
> </bean>
> I think it could be interesting for the users to define transaction attributes directly in the POJO using annotations.
> For instance, it could be helpful to support the following annotations:
> @PostConstruct
> @PreDestroy
> @Resource
> @TransactionAttribute
> For instance, myPojo will look like:
> public class MyPojo {
>   @TransactionAttribute=Required
>   public void setData(Data data) {
>     ...
>   }
> } 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (ARIES-628) Support JTA attributes by annotations

Posted by "Timothy Ward (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Ward reassigned ARIES-628:
----------------------------------

    Assignee: Timothy Ward
    
> Support JTA attributes by annotations
> -------------------------------------
>
>                 Key: ARIES-628
>                 URL: https://issues.apache.org/jira/browse/ARIES-628
>             Project: Aries
>          Issue Type: New Feature
>          Components: Transaction
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Timothy Ward
>
> currently, we can use a Blueprint descriptor to define the transaction attribute associated to methods:
> <bean id="myPojo" class="myPojo" init-method="init">
>   <tx:transaction method="set*" value="Required"/>
>   <tx:transaction method="get*" value="Supported"/>
> </bean>
> I think it could be interesting for the users to define transaction attributes directly in the POJO using annotations.
> For instance, it could be helpful to support the following annotations:
> @PostConstruct
> @PreDestroy
> @Resource
> @TransactionAttribute
> For instance, myPojo will look like:
> public class MyPojo {
>   @TransactionAttribute=Required
>   public void setData(Data data) {
>     ...
>   }
> } 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ARIES-628) Support JTA attributes by annotations

Posted by "Bengt Rodehav (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057764#comment-13057764 ] 

Bengt Rodehav commented on ARIES-628:
-------------------------------------

I think this is very important. Specifying transaction attributes in XML using wildcards is just not programmer friendly enough. I think Aries definitely needs to support annotation based transaction attributes.

Similar to old XDoclet I think transaction attributes should be allowed both on the class level and the method level. The attribute on the class level will then be the default for all methods but will be overridden by the annotation on the method level.

> Support JTA attributes by annotations
> -------------------------------------
>
>                 Key: ARIES-628
>                 URL: https://issues.apache.org/jira/browse/ARIES-628
>             Project: Aries
>          Issue Type: New Feature
>          Components: Transaction
>            Reporter: Jean-Baptiste Onofré
>
> currently, we can use a Blueprint descriptor to define the transaction attribute associated to methods:
> <bean id="myPojo" class="myPojo" init-method="init">
>   <tx:transaction method="set*" value="Required"/>
>   <tx:transaction method="get*" value="Supported"/>
> </bean>
> I think it could be interesting for the users to define transaction attributes directly in the POJO using annotations.
> For instance, it could be helpful to support the following annotations:
> @PostConstruct
> @PreDestroy
> @Resource
> @TransactionAttribute
> For instance, myPojo will look like:
> public class MyPojo {
>   @TransactionAttribute=Required
>   public void setData(Data data) {
>     ...
>   }
> } 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ARIES-628) Support JTA attributes by annotations

Posted by "Timothy Ward (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201222#comment-13201222 ] 

Timothy Ward commented on ARIES-628:
------------------------------------

I have added basic support, using a simple annotation in the new org.apache.aries.transaction.annotations package. What do people think of this approach? It can be altered/enhanced to understand the javax.ejb and org.springframework equivalents.

I see another major improvement as being the ability to distinguish methods based on parameters as well as name (to allow overloaded methods to have different transaction semantics). Does anyone else have any suggestions in this area?
                
> Support JTA attributes by annotations
> -------------------------------------
>
>                 Key: ARIES-628
>                 URL: https://issues.apache.org/jira/browse/ARIES-628
>             Project: Aries
>          Issue Type: New Feature
>          Components: Transaction
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Timothy Ward
>
> currently, we can use a Blueprint descriptor to define the transaction attribute associated to methods:
> <bean id="myPojo" class="myPojo" init-method="init">
>   <tx:transaction method="set*" value="Required"/>
>   <tx:transaction method="get*" value="Supported"/>
> </bean>
> I think it could be interesting for the users to define transaction attributes directly in the POJO using annotations.
> For instance, it could be helpful to support the following annotations:
> @PostConstruct
> @PreDestroy
> @Resource
> @TransactionAttribute
> For instance, myPojo will look like:
> public class MyPojo {
>   @TransactionAttribute=Required
>   public void setData(Data data) {
>     ...
>   }
> } 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira