tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: Outbound resource injection in an ejb
Date Tue, 26 Jan 2010 03:34:21 GMT

On Jan 22, 2010, at 11:11 PM, Jason Russo wrote:

> Ok, so I figured this out myself and it works very nicely.  Some notes
> for anyone else who wants to do this:
> I created a service-jar.xml file, and in it defined several service
> provider tags for the main adapter class
> (com.sun.genericra.GenericJMSRA), as well as for queue, topic, and
> connection factory proxies in the service-jar.xml.  Within those  
> service
> provider tags I listed the setter properties of those classes that are
> pertinent to defining a remote connection.  For example:
> <ServiceJar>
>    <ServiceProvider id="genericra" service="Resource"
> types="GenericJMSRA" class-name="com.sun.genericra.GenericJMSRA">
>        AdapterProperty1
>        AdapterProperty2
>        ...
>    </ServiceProvider>
> </ServiceJar>
> Then I repackaged genericra.jar, adding the service-jar.xml as
> META-INF/com.sun.genericra/service-jar.xml.
> Placed the genericra.jar file in openejb.home/lib (or, tomcat.home/lib
> if embedding openejb in tomcat).
> Added sections in the openejb.xml file for my resources (adapter,
> connection factory, queues and topics) to override the properties in
> service-jar.xml with actual values.  Then defined some new  
> containers in
> openejb.xml using the adapters, and walla!  Message driven beans work
> very nicely.
> One caveat: when defining a resource in openejb.xml, make sure to  
> add a
> provider attribute and prefix it with com.sun.genericra#<providerid>.
> So the openejb resource entry will look like this:
> <Resource id="My Generic Adapter" type="GenericJMSRA"
> jar="genericra-1.0.jar" provider="com.sun.genericra#genericra">
>    AdapterProperty1            PropertyValue1
>    AdapterProperty2            PropertyValue2
>    ...
> </Resource>
> If the openejb dev group wants my genericra.jar to embed as a built in
> service for external jms provider support, I can contribute my  
> adapter.

This is great, Jason!

Do you know what the license of the GenericJMSRA is?

This could be a great contribution.


View raw message