geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Adding new deployable module types
Date Sat, 10 Jun 2006 22:08:50 GMT

On Jun 10, 2006, at 2:45 PM, Stefan Arentz wrote:

> On 6/10/06, David Jencks <> wrote:
> ...
>> > You can also package the resource and application as plugins, so  
>> they
>> > could be separate but anyone who installed the application plugin
>> > would automatically get the realm and pool and so on.
>> I think the missing piece is making the stuff deployed this way
>> accessible through spring.  I think the way to to is is with spring
>> beans that look up the gbeans: then you can use spring injection to
>> get the e.g. datasource into your spring bean.
> What would be the advantage of talking to GBeans instead of doing a
> simple JNDI lookup?

- right now jndi is only available in j2ee apps.  Global jndi is  
expected in 1.2, but I think it's a terrible idea :-).  If you really  
want jndi, I'd work on something like the j2ee description of how to  
put stuff in java:comp
- Why would you consider using jndi when you have a dependency  
injection system available from spring?

Maybe I'm misunderstanding your question, so I'll explain how looking  
up a datasource in jndi works now:
- we bind a reference into jndi.  It contains the kernel name and  
gbean name for a ManagedConnectionFactoryWrapper gbean
- when you look up the reference, to resolve what it points to, it  
finds the gbean in the kernel and calls a method, $getResource, which  
returns (a proxy to) the connection factory.  We return the  
connection factory as the lookup result.

IIUC Spring has a way of injecting the result of calling a method on  
a spring bean as a constructor or setter parameter.  I'm thinking  
that we should have in this case a spring bean that has a method that  
delegates to the $getResource method, so you can use spring to inject  
the datasource that is set up in geronimo.

david jencks

> S.

View raw message