[jboss-user] [JNDI/Naming/Network] - Remote JNDI lookup best practise.

pieter.jvrensburg do-not-reply at jboss.com
Tue Oct 2 04:41:50 EDT 2007


I am trying to find out what is the best way of using a remote object acquired through a lookup...

Currently I am thinking of using one of these two techniques:
1. Do a lookup every time I want to use the remote object.
2. Do the lookup once, use it and only when it fails (for whatever reason), perform the lookup again.

The remote lookup code:


  | Hashtable<String, String> env = new Hashtable<String, String>();
  | env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
  | env.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
  | env.put("jnp.discoveryTimeout", "1000");
  | env.put(Context.PROVIDER_URL, remotehost);
  | 
  | InitialContext ctx = new InitialContext(env);
  | ctx.lookup(jndiName);
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090535#4090535

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090535



More information about the jboss-user mailing list