tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: Outbound resource injection in an ejb
Date Fri, 29 Jan 2010 10:43:34 GMT

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

-- 
http://blog.dblevins.com/
http://twitter.com/dblevins
Support OpenEJB with Tweets!




Mime
View raw message