users@glassfish.java.net

Re: InitialContext on remote server

From: <glassfish_at_javadesktop.org>
Date: Thu, 04 Dec 2008 10:07:59 PST

Thanks for the quick response but the solution provided, I don't think, allows me to do what I need. Here is a pseudo code example of what I would like to accomplish.

Database Table SERVERS:
ServerName IPAddress
----------------- ----------------
Server1 1.1.1.1
Server2 2.2.2.2
Server3 3.3.3.3


env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
env.put("org.omg.CORBA.ORBInitialPort", "3967");
QueryServerDB()
Loop resultSet {
   env.put("org.omg.CORBA.ORBInitialHost", resultSet.get("IPAddress");
   Context ic = new InitialContext(env);

   ic.lookup(an EJB or JMSFactory/Queue);

   call EJBMethod() or postMessage(queue);
}

I do not want to have to recompile code each time a server is added to the DB.
If I use @Annotations or xml files, I will have to recompile/redeploy
[Message sent by forum member 'janchj' (janchj)]

http://forums.java.net/jive/thread.jspa?messageID=320105