openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: Custom Resource Factory
Date Fri, 08 Aug 2008 00:25:34 GMT

On Aug 7, 2008, at 8:32 AM, lupu.slobodu wrote:

> I dont know if the custom injection is flexible enough.I need to be  
> able to
> load multiple xml configuration files.Is it possible with the custom
> injection mechanism? If I use the openejb embedded in tomcat,  you  
> think it
> is possible to plugin the  ObjectFactory in the tomcat jndi and look  
> it up
> from a openejb session bean?

We've coded up the tomcat integration to be able to support that.  So  
if you add an ObjectFactory to Tomcat, OpenEJB will pick it up and add  
it like it was an <Resource> declaration in the openejb.xml file.

So if you had a META-INF/context.xml file in your webbapp for Tomcat  
like the following:


You should be able to have it injected like so:

   @Resource ResourceBean byBean;

Let us know if that does or doesn't work.  We need more examples of  

As a side question, are you currently doing something like this in  
Tomcat now or are you looking for a more general purpose "define  
objects in xml and inject them" solution?  We've had some ideas in  
this area.


> David Blevins wrote:
>> On Aug 6, 2008, at 7:54 AM, lupu.slobodu wrote:
>>> How can one configure a custom resource factory(implementation of  
>>> the
>>> javax.naming.spi.ObjectFactory interface). The custom resource  
>>> factory
>>> should be injectable into a stateless.
>> We don't have anything for pluging in an
>> javax.naming.spi.ObjectFactory, but we do have the ability for you to
>> plug in your own java.beans.PropertyEditor and have custom resources
>> injected that way.
>> See this example for details:
>> -David
> -- 
> View this message in context:
> Sent from the OpenEJB User mailing list archive at

View raw message