geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacek Laskowski" <ja...@laskowski.net.pl>
Subject Re: Gbean and EJBs
Date Tue, 08 Jan 2008 07:52:10 GMT
On Jan 8, 2008 8:24 AM, ivanrc <iriano@indra.es> wrote:

> How can Gbean obtain the global jndi?

During "the simplest and easiest approaches" day everything should be
simplest and easiest (as well as intuitive) so your best bet would be
to look at gbean as any other java remote client and do the following:

        Properties properties = new Properties();
        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");

        Context ctx = new InitialContext(properties);
        MyEjbBeanIntf myEjbBean = (MyEjbBeanIntf) ctx.lookup("MyEjbBeanLocal");

As the gbean's actually part of the server environment, I'd expect you
can leave off the Context.INITIAL_CONTEXT_FACTORY setting and look up
ejbs without it.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Mime
View raw message