You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Matt Madhavan <ma...@gmail.com> on 2011/05/11 16:56:29 UTC

Blueprint JTA Annotations?

Hello,
We are using Aries Blueprint and OpenJPA 2.0. I'm investigating how to mark
my methods transactional using annotational!



Going forward we would like to use Blueprint based annotations instead of
verbose xml files.

I would like to annotate my class as follows:

public class BlogPersistenceServiceImpl* *implements BlogPersistenceService
{

   *@PersistenceContext(unitName="blogExample")*
private EntityManager em;


     *@TransactionAttribute=Required   *
     public void createAuthor(String email, Date dob, String name,
String displayName, String bio) {
AuthorImpl a = new AuthorImpl();
         ....
      }

Is it possible to do @*TransactionAttribute *in Aries? Any help will be
appreciated!

Currently my persistence service class is defined in blueprint.xml as
follows:

<bean id="persistenceImpl"
class="com.xxxxx.jpa.dao.BlogPersistenceServiceImpl">
<tx:transaction method="*" value="Required" />
<jpa:context property="entityManager" unitname="blogExample" />
</bean>

<service id="blogJPAPersistenceService" ref="persistenceImpl"
interface="com.xxxxx.jpa.api.persistence.BlogPersistenceService">
   <service-properties>
      <entry key="osgi.jndi.service.name"
value="persistence/bpJPAPersistenceService"/>
    </service-properties>
 </service>

Thanks in advance!
Matt

Re: Blueprint JTA Annotations?

Posted by Matt Madhavan <ma...@gmail.com>.
HI JB,
I did see the JIRA thx. Let me know if I can be off help.

Also do you about this Aries BluePrint extension project and this
namespace:
http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0

<http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0>Thanks
Matt


On Wed, May 11, 2011 at 2:18 PM, Jean-Baptiste Onofré <jb...@nanthrax.net>wrote:

> Hi Matt,
>
> the JTA annotations are not yet supported by Aries JTA.
>
> I raised a Jira about that:
> https://issues.apache.org/jira/browse/ARIES-628
>
> I plan to work on it in the following weeks.
>
> Regards
> JB
>
>
> On 05/11/2011 04:56 PM, Matt Madhavan wrote:
>
>> Hello,
>> We are using Aries Blueprint and OpenJPA 2.0. I'm investigating how to
>> mark my methods transactional using annotational!
>>
>>
>>
>> Going forward we would like to use Blueprint based annotations instead
>> of verbose xml files.
>>
>> I would like to annotate my class as follows:
>>
>> public class BlogPersistenceServiceImpl**implements BlogPersistenceService
>> {
>> *@PersistenceContext(unitName="blogExample")*
>> private EntityManager em;
>>
>> *@TransactionAttribute=Required *
>>      public void createAuthor(String email, Date dob, String name,
>> String displayName, String bio) {
>> AuthorImpl a = new AuthorImpl();
>>          ....
>>       }
>>
>> Is it possible to do @*TransactionAttribute *in Aries? Any help will be
>> appreciated!
>>
>> Currently my persistence service class is defined in blueprint.xml as
>> follows:
>>
>> <bean id="persistenceImpl"
>> class="com.xxxxx.jpa.dao.BlogPersistenceServiceImpl">
>> <tx:transaction method="*" value="Required" />
>> <jpa:context property="entityManager" unitname="blogExample" />
>> </bean>
>>
>> <service id="blogJPAPersistenceService" ref="persistenceImpl"
>> interface="com.xxxxx.jpa.api.persistence.BlogPersistenceService">
>> <service-properties>
>> <entry key="osgi.jndi.service.name <http://osgi.jndi.service.name>"
>>
>> value="persistence/bpJPAPersistenceService"/>
>> </service-properties>
>> </service>
>>
>> Thanks in advance!
>> Matt
>>
>>

Re: Blueprint JTA Annotations?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Matt,

the JTA annotations are not yet supported by Aries JTA.

I raised a Jira about that:
https://issues.apache.org/jira/browse/ARIES-628

I plan to work on it in the following weeks.

Regards
JB

On 05/11/2011 04:56 PM, Matt Madhavan wrote:
> Hello,
> We are using Aries Blueprint and OpenJPA 2.0. I'm investigating how to
> mark my methods transactional using annotational!
>
>
>
> Going forward we would like to use Blueprint based annotations instead
> of verbose xml files.
>
> I would like to annotate my class as follows:
>
> public class BlogPersistenceServiceImpl**implements BlogPersistenceService {
> *@PersistenceContext(unitName="blogExample")*
> private EntityManager em;
>
> *@TransactionAttribute=Required *
>       public void createAuthor(String email, Date dob, String name,
> String displayName, String bio) {
> AuthorImpl a = new AuthorImpl();
>           ....
>        }
>
> Is it possible to do @*TransactionAttribute *in Aries? Any help will be
> appreciated!
>
> Currently my persistence service class is defined in blueprint.xml as
> follows:
>
> <bean id="persistenceImpl"
> class="com.xxxxx.jpa.dao.BlogPersistenceServiceImpl">
> <tx:transaction method="*" value="Required" />
> <jpa:context property="entityManager" unitname="blogExample" />
> </bean>
>
> <service id="blogJPAPersistenceService" ref="persistenceImpl"
> interface="com.xxxxx.jpa.api.persistence.BlogPersistenceService">
> <service-properties>
> <entry key="osgi.jndi.service.name <http://osgi.jndi.service.name>"
> value="persistence/bpJPAPersistenceService"/>
> </service-properties>
> </service>
>
> Thanks in advance!
> Matt
>

Re: Blueprint JTA Annotations?

Posted by Matt Madhavan <ma...@gmail.com>.
Hi Valentine,
Thanks it makes a little sense now! I was little confused b'cause the url,
like you mentioned is pointing to void!

I'm wondering it what are the other options/features this BluePrint-ext has!
Any ideas?

Thanks
Matt

On Thu, May 12, 2011 at 1:08 AM, Valentin Mahrwald <vmahrwald@googlemail.com
> wrote:

> Hi Matt,
>
> the blueprint-ext namespace (unfortunately the URL as usual points into the
> void) contains property placeholders (for the old config admin work), i.e.
> properties containing placeholders like ${user.name}, and field injection
> (what the RedBook referred to). The namespace itself is included and handled
> by the core Aries Blueprint bundle so it will always be available.
>
> Hope this helps,
>
> Valentin
>
> On 11 May 2011, at 19:55, Matt Madhavan wrote:
>
> Hi Tim,
> Thanks for the reply! Meanwhile yesterday I tested all the annotation
> configuration (Beta) from the blueprint. They all worked great! The sample
> was missing the service tracking and I enhanced the test to include those
> tests as well. They seem to work just fine!
>
> IBM Redbook mentions the following link!
>
> http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0
>
> Any idea about this BluePrint extension from Aries?
>
> I'm very busy setting the OSGi dev env for my client at this point. Also I
> promised the PAX folks I will contribute to them as well. Not sure how much
> time I have at this point. Let me see what I can do!
>
> Thanks
> Matt
>
>
> On Wed, May 11, 2011 at 12:48 PM, Timothy Ward <ti...@apache.org>wrote:
>
>>
>> Hi Matt,
>>
>> I'm afraid there is currently no support for annotation-based
>> configuration in aries blueprint. We are prototyping annotation
>> configuration for blueprint, but this doesn't currently include support for
>> custom namespaces like transactions. If you have anything you'd like to
>> contribute in this area you'd be more than welcome!
>>
>> Regards,
>>
>> Tim
>>
>> ________________________________
>> > Date: Wed, 11 May 2011 09:56:29 -0500
>> > Subject: Blueprint JTA Annotations?
>> > From: mattmadhavan@gmail.com
>> > To: user@aries.apache.org
>> >
>> > Hello,
>> > We are using Aries Blueprint and OpenJPA 2.0. I'm investigating how to
>> > mark my methods transactional using annotational!
>> >
>> >
>> >
>> > Going forward we would like to use Blueprint based annotations instead
>> > of verbose xml files.
>> >
>> > I would like to annotate my class as follows:
>> >
>> > public class BlogPersistenceServiceImpl implements
>> BlogPersistenceService {
>> >
>> > @PersistenceContext(unitName="blogExample")
>> > private EntityManager em;
>> >
>> >
>> > @TransactionAttribute=Required
>> > public void createAuthor(String email, Date dob, String name,
>> > String displayName, String bio) {
>> > AuthorImpl a = new AuthorImpl();
>> > ....
>> > }
>> >
>> > Is it possible to do @TransactionAttribute in Aries? Any help will be
>> > appreciated!
>> >
>> > Currently my persistence service class is defined in blueprint.xml as
>> > follows:
>> >
>> > > class="com.xxxxx.jpa.dao.BlogPersistenceServiceImpl">
>> >
>> >
>> >
>> >
>> > > interface="com.xxxxx.jpa.api.persistence.BlogPersistenceService">
>> >
>> > > key="osgi.jndi.service.name"
>> > value="persistence/bpJPAPersistenceService"/>
>> >
>> >
>> >
>> > Thanks in advance!
>> > Matt
>> >
>>
>
>
>
>

Re: Blueprint JTA Annotations?

Posted by Valentin Mahrwald <vm...@googlemail.com>.
Hi Matt,

the blueprint-ext namespace (unfortunately the URL as usual points into the void) contains property placeholders (for the old config admin work), i.e. properties containing placeholders like ${user.name}, and field injection (what the RedBook referred to). The namespace itself is included and handled by the core Aries Blueprint bundle so it will always be available.

Hope this helps,

Valentin

On 11 May 2011, at 19:55, Matt Madhavan wrote:

> Hi Tim,
> Thanks for the reply! Meanwhile yesterday I tested all the annotation configuration (Beta) from the blueprint. They all worked great! The sample was missing the service tracking and I enhanced the test to include those tests as well. They seem to work just fine!
> 
> IBM Redbook mentions the following link! 
> 
> http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0
> 
> Any idea about this BluePrint extension from Aries? 
> 
> I'm very busy setting the OSGi dev env for my client at this point. Also I promised the PAX folks I will contribute to them as well. Not sure how much time I have at this point. Let me see what I can do!
> 
> Thanks
> Matt
> 
> 
> On Wed, May 11, 2011 at 12:48 PM, Timothy Ward <ti...@apache.org> wrote:
> 
> Hi Matt,
> 
> I'm afraid there is currently no support for annotation-based configuration in aries blueprint. We are prototyping annotation configuration for blueprint, but this doesn't currently include support for custom namespaces like transactions. If you have anything you'd like to contribute in this area you'd be more than welcome!
> 
> Regards,
> 
> Tim
> 
> ________________________________
> > Date: Wed, 11 May 2011 09:56:29 -0500
> > Subject: Blueprint JTA Annotations?
> > From: mattmadhavan@gmail.com
> > To: user@aries.apache.org
> >
> > Hello,
> > We are using Aries Blueprint and OpenJPA 2.0. I'm investigating how to
> > mark my methods transactional using annotational!
> >
> >
> >
> > Going forward we would like to use Blueprint based annotations instead
> > of verbose xml files.
> >
> > I would like to annotate my class as follows:
> >
> > public class BlogPersistenceServiceImpl implements BlogPersistenceService {
> >
> > @PersistenceContext(unitName="blogExample")
> > private EntityManager em;
> >
> >
> > @TransactionAttribute=Required
> > public void createAuthor(String email, Date dob, String name,
> > String displayName, String bio) {
> > AuthorImpl a = new AuthorImpl();
> > ....
> > }
> >
> > Is it possible to do @TransactionAttribute in Aries? Any help will be
> > appreciated!
> >
> > Currently my persistence service class is defined in blueprint.xml as
> > follows:
> >
> > > class="com.xxxxx.jpa.dao.BlogPersistenceServiceImpl">
> >
> >
> >
> >
> > > interface="com.xxxxx.jpa.api.persistence.BlogPersistenceService">
> >
> > > key="osgi.jndi.service.name"
> > value="persistence/bpJPAPersistenceService"/>
> >
> >
> >
> > Thanks in advance!
> > Matt
> >
>                                          
> 


Re: Blueprint JTA Annotations?

Posted by Matt Madhavan <ma...@gmail.com>.
Hi Tim,
Thanks for the reply! Meanwhile yesterday I tested all the annotation
configuration (Beta) from the blueprint. They all worked great! The sample
was missing the service tracking and I enhanced the test to include those
tests as well. They seem to work just fine!

IBM Redbook mentions the following link!

http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0

Any idea about this BluePrint extension from Aries?

I'm very busy setting the OSGi dev env for my client at this point. Also I
promised the PAX folks I will contribute to them as well. Not sure how much
time I have at this point. Let me see what I can do!

Thanks
Matt


On Wed, May 11, 2011 at 12:48 PM, Timothy Ward <ti...@apache.org>wrote:

>
> Hi Matt,
>
> I'm afraid there is currently no support for annotation-based configuration
> in aries blueprint. We are prototyping annotation configuration for
> blueprint, but this doesn't currently include support for custom namespaces
> like transactions. If you have anything you'd like to contribute in this
> area you'd be more than welcome!
>
> Regards,
>
> Tim
>
> ________________________________
> > Date: Wed, 11 May 2011 09:56:29 -0500
> > Subject: Blueprint JTA Annotations?
> > From: mattmadhavan@gmail.com
> > To: user@aries.apache.org
> >
> > Hello,
> > We are using Aries Blueprint and OpenJPA 2.0. I'm investigating how to
> > mark my methods transactional using annotational!
> >
> >
> >
> > Going forward we would like to use Blueprint based annotations instead
> > of verbose xml files.
> >
> > I would like to annotate my class as follows:
> >
> > public class BlogPersistenceServiceImpl implements BlogPersistenceService
> {
> >
> > @PersistenceContext(unitName="blogExample")
> > private EntityManager em;
> >
> >
> > @TransactionAttribute=Required
> > public void createAuthor(String email, Date dob, String name,
> > String displayName, String bio) {
> > AuthorImpl a = new AuthorImpl();
> > ....
> > }
> >
> > Is it possible to do @TransactionAttribute in Aries? Any help will be
> > appreciated!
> >
> > Currently my persistence service class is defined in blueprint.xml as
> > follows:
> >
> > > class="com.xxxxx.jpa.dao.BlogPersistenceServiceImpl">
> >
> >
> >
> >
> > > interface="com.xxxxx.jpa.api.persistence.BlogPersistenceService">
> >
> > > key="osgi.jndi.service.name"
> > value="persistence/bpJPAPersistenceService"/>
> >
> >
> >
> > Thanks in advance!
> > Matt
> >
>

RE: Blueprint JTA Annotations?

Posted by Timothy Ward <ti...@apache.org>.
Hi Matt,

I'm afraid there is currently no support for annotation-based configuration in aries blueprint. We are prototyping annotation configuration for blueprint, but this doesn't currently include support for custom namespaces like transactions. If you have anything you'd like to contribute in this area you'd be more than welcome!

Regards,

Tim

________________________________
> Date: Wed, 11 May 2011 09:56:29 -0500
> Subject: Blueprint JTA Annotations?
> From: mattmadhavan@gmail.com
> To: user@aries.apache.org
>
> Hello,
> We are using Aries Blueprint and OpenJPA 2.0. I'm investigating how to
> mark my methods transactional using annotational!
>
>
>
> Going forward we would like to use Blueprint based annotations instead
> of verbose xml files.
>
> I would like to annotate my class as follows:
>
> public class BlogPersistenceServiceImpl implements BlogPersistenceService {
>
> @PersistenceContext(unitName="blogExample")
> private EntityManager em;
>
>
> @TransactionAttribute=Required
> public void createAuthor(String email, Date dob, String name,
> String displayName, String bio) {
> AuthorImpl a = new AuthorImpl();
> ....
> }
>
> Is it possible to do @TransactionAttribute in Aries? Any help will be
> appreciated!
>
> Currently my persistence service class is defined in blueprint.xml as
> follows:
>
> > class="com.xxxxx.jpa.dao.BlogPersistenceServiceImpl">
>
>
>
>
> > interface="com.xxxxx.jpa.api.persistence.BlogPersistenceService">
>
> > key="osgi.jndi.service.name"
> value="persistence/bpJPAPersistenceService"/>
>
>
>
> Thanks in advance!
> Matt
>