users@glassfish.java.net

Re: _at_Resource in Resource Adapter

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Tue, 27 May 2008 10:37:55 +0530

Hi Markus

>>> Is it possible in JavaEE 5 to replace JNDI lookups by @Resource inside
>>> of a Resource Adapter, and if it is possible, can it be done in any
>>> class inside of the .rar or only in the ResourceAdapterBean class?

Though resource adapter ease of development is being considered as part
of JSR 322 (Connectors 1.6), @Resource annotations within a RA however,
is not being considered for the following reason: The RA is not an
application component like EJB/Servlets and does not have the ability to
define resource-references to managed resources in the container runtime.

The ResourceAdapter javabean (or a class within the RAR) can always
choose to perform a JNDI lookup on the "physical" JNDI name of a
configured resource, and this would work in GlassFish, but this usage is
non-portable and may not work in other application servers.

Thanks
--Siva.

Sahoo wrote:
> JCA spec was not updated in Java EE 5 release, so no, RARs can't use
> annotations in Java EE 5. I believe it is being worked in the next rev
> of JCA spec likely to be part of Java EE 6.
>
> Thanks,
> Sahoo
>
> Markus Karg wrote:
>>
>> Is it possible in JavaEE 5 to replace JNDI lookups by @Resource inside
>> of a Resource Adapter, and if it is possible, can it be done in any
>> class inside of the .rar or only in the ResourceAdapterBean class?
>>
>>
>>
>> Thanks
>>
>> Markus