geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: ejbs in global jndi?
Date Thu, 21 Jun 2007 16:26:05 GMT

On Jun 21, 2007, at 8:18 AM, David Jencks wrote:

> This is pretty much speculation on my part, I haven't tried  
> anything to see if it already is implemented...
>
> Openejb has a nice global jndi context for all the ejbs, but I  
> don't think its bound into the geronimo global jndi space.  I  
> suspect it's possible to get it using the appropriate jndi  
> Properties in a new InitialContext(props) call, but I don't even  
> know how to do that.

I'd be:

   Properties properties = new Properties();

   properties.put(Context.INITIAL_CONTEXT_FACTORY,
         "org.apache.openejb.client.LocalInitialContextFactory");

   InitialContext ctx = new InitialContext(properties);

As far as getting the ejb global context, this is the least volatile  
way and has remained pretty consistent across 0.x, 1.x, 2.x, and  
3.x.  Even the old package name org.openejb.client still works for  
backwards compatible reasons.

>
> I think it would be very convenient to bind the openejb context  
> into geronimo's global context.  I'm not entirely sure how to do  
> this.  One idea is to write a GBean implementing Context that  
> delegates to
>
> SystemInstance.get().getComponent 
> (ContainerSystem.class).getJNDIContext()
>
> and registers with geronimo's GlobalContextGBean to get bound (and  
> presumably federated).
>
> Can anyone think of a better way?  Perhaps another possibility is  
> to write a GeronimoOpenejbContextGBean that is a subclass of  
> IvmContext so it can register with the GlobalContextGBean, and also  
> registers a ContainerSystem implementation with openejb's  
> SystemInstance?  This would avoid the delegation step.

As far as how to actually get the context into the G Global JNDI  
Context, I'm not sure.  Seems that context will ultimately delegate  
(federate) to this context.  IIRC from talking with Dain about this  
when he was hacking on it is that there should be some way to bind  
another context in at a given path in the G Global context in some  
sort of factory-like "here's my context, you deal with it" sort of way.

If there isn't, we should just add that.

-David


Mime
View raw message