tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Russo <jru...@genscape.com>
Subject Re: Outbound resource injection in an ejb
Date Fri, 29 Jan 2010 14:21:44 GMT
That sounds pretty neat.  I did not modify any of the resource adapter
code.  What I did was add this file
as /META-INF/com.sun.genericra/service-jar.xml inside the adapter jar,
and drop that library into the container lib folder along with the jms
client libraries needed for the jms provider(s).

So, who shall I send my service-jar.xml to, and how?  Do you want me to
submit it to this mailing list, or the dev list, check it in somehow,
other details?  This would be the first contribution I've provided to
the openejb community, so I'm not sure what the procedures would be.

One thing I'd like to mention is, when I was first using this with
Tibco, I had defined some properties in the service-jar.xml that needed
to be null.  It appears, however, that if a property is defined in
service-jar.xml and no value is assigned to it, openejb will auto assign
an empty string value to them.  This had caused some problems with
Tibco, specifically with the client id property.  When Tibco saw the
client id as an empty string, I had issues with 'duplicate' client ids
(all being empty strings).  My solution was to remove the property from
the service provider in the service-jar.xml file.  I bring this up to
make you aware of this possible pitfall, as other providers might also
have issues with other properties.  Not sure if I should just remove all
properties from the service providers, and maybe allow them to be
overridden in openejb.xml or not, but right now I just did this for the
client id property.

Anyways, let me know how to proceed with this contribution, and I will
act accordingly.



Jason Russo

Application Developer

Genscape– See the Energy

445 E. Market St, Suite 200

Louisville, KY 40202

Tel: 502-583-2091

www.genscape.com



On Fri, 2010-01-29 at 05:43 -0500, David Blevins wrote:

> On Jan 26, 2010, at 3:37 PM, Jason Russo wrote:
> 
> > I believe it is open source.  See this page:
> >
> > https://genericjmsra.dev.java.net/docs/userguide/userguide.html
> >
> > If you want it, just let me know to who and where to send it.  I can
> > contribute the jar alone, or, in addition, separately provide the
> > service-jar.xml and a sample openejb configuration that I got working.
> > Or I can provide just the service-jar.xml and you can grab the source
> > code from java.net if that's the way you would prefer to do it.
> 
> Definitely the service-jar.xml.  If there's custom code you had to  
> write to get it to work, then definitely we'd want it too.
> 
> So one of the neat things about the service-jar.xml concept is that  
> everything in it is pretty much dormant until someone attempts to use  
> one of it's services in an openejb.xml config file.  Looking at the  
> docs for the GenericJMSRA it seems clear that they're targeting a few  
> common messaging implementations.  We could actually provide a service- 
> jar.xml that *wasn't* so generic and had all the properties setup for  
> each of these platforms.  It would be the same adapter class defined  
> over and over again, sort of like different "profiles".
> 
> Something like:
> 
>    <ServiceJar>
>      <ServiceProvider id="IBMMQ" service="Resource"
>                       types="GenericJMSRA"
>                       class-name="com.sun.genericra.GenericJMSRA">
>        ...
>      </ServiceProvider>
> 
>      <ServiceProvider id="OracleAQ" service="Resource"
>                       types="GenericJMSRA"
>                       class-name="com.sun.genericra.GenericJMSRA">
>        ...
>      </ServiceProvider>
> 
>      <ServiceProvider id="TibcoEMS" service="Resource"
>                       types="GenericJMSRA"
>                       class-name="com.sun.genericra.GenericJMSRA">
>        ...
>      </ServiceProvider>
> 
>      <ServiceProvider id="SonicMQ" service="Resource"
>                       types="GenericJMSRA"
>                       class-name="com.sun.genericra.GenericJMSRA">
>        ...
>      </ServiceProvider>
> 
>    </ServiceJar>
> 
> 
> Then in your openejb.xml you just need to specify the properties you  
> want to override from the defaults for that provider:
> 
>    <Resource id="My Generic Adapter" type="GenericJMSRA"
>       jar="genericra-1.0.jar" provider="com.sun.genericra#SonicMQ">
>       AdapterProperty1            PropertyValue1
>       AdapterProperty2            PropertyValue2
>       ...
>    </Resource>
> 
> 
> Thoughts?
> 
> 
> -David
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message