> You are correct that obtaining the InitialContext requires different
> parameters depending on the EJB container you are using, but the
> process of
> obtaining this context is the same. Portability is achieved by placing the
> vendor specific parameters in a properties file that is external to your
> application.
No, that's not right. Here are three examples:
1)---------------------------------------------
Properties p = new Properties();
p.put(com.genstone.naming.Defaults.NAME_SERVICE_HOST,"localhost");
String port =
System.getProperty("com.gemstone.naming.NameServicePort","10200");
p.put(com.gemstone.naming.Defaults.NAME_SERVICE_PORT,port);
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.gemstone.naming.GsCtxFactory");
Context ctx = new InitialContext(p);
myEJBhome ejbHome = ctx.lookup("myEJBHome");
2)---------------------------------------------
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.T3InitialContextFactory
");
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context ctx = new InitialContext(p);
myEJBhome ejbHome = ctx.lookup("myEJBHome");
3)---------------------------------------------
Context ctx = new InitialContex();
Object objref = ctx.lookup("myEJBHome");
myEJBHome ejbHome =
(myEJBHome)PortableRemoteObject.narrow(objref,myEJBHome.class);
The first two examples are from O'Reilly's Enterprise JavaBeans book by
Richard Monson-Haefel. Number one is for Gemstone/J and the second is for
BEA's WebLogic Server. The third example is taken for Sun's tutorial on
EJB. Each is different and requires programming beyond just supplying
startup parms. Am I missing something?
-Ron
> ----- Original Message -----
> From: Ron Yust <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, October 20, 1999 10:19 AM
> Subject: EJB client context
>
>
> > I'm setting up an EJB client application that would support
> different EJB
> > servers. I've discovered that the clients could have different methods
> for
> > obtaining a JNDI context for each server depending on the EJB vendor.
> > Doesn't this decrease the portability of EJB if I have to modify client
> code
> > for each installation? I was hoping that it would be as simple
> as coding
> > Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL properties for
> each
> > vendor (which could be supplied as client startup properties) and then
> > obtaining a InitialContext.
> >
> > Am I missing something? Has anyone gotten around this and developed a
> > generic way for clients to obtain the server context? Thanks.
> >
> > Ron Yust
> > Director of Information Services
> > Empire District Electric Co.
> > (417) 625-5126 voice
> > (417) 625-5155 fax
> >
> >
> >
>
> ==================================================================
> =========
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".