0 Replies Latest reply on Oct 3, 2007 3:25 AM by haribaasha

    JNDI lookup across partitions and local

    haribaasha

      Hi
      I use a servicelocator which is a generic class which will return to me a remote stub based on the ejb requested with a jndi name. so i have about 3 different ejbs providing different services running in a cluster. now one of the ejb runs in a totally different partition. I do the lookup using


      Properties p = new Properties();
      p.put("jnp.partitionName", "IndicsPartition"); //indicspartition is my partition name
      p.put("jnp.discoveryGroup", "230.0.0.4");
      Context initial = new InitialContext(p);

      the other ejb's are deployed locally or in the same cluster. for the local or remote lookup in a cluster we already have
      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES,"jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "localhost:1100"); // HA-JNDI port
      initial = new InitialContext(p);

      Do i need to have these both as different cases and try each or can i have one context which will be able to load it from IndicsPartition if available or from teh local cluster if availbale ?

      Thanks
      hari