Package javax.naming

Examples of javax.naming.InitialContext.createSubcontext()


      getLog().debug("lookup('') against HA-JNDI succeeded as expected, obj="+obj);

      ctx.createSubcontext("foo");
      try
      {
         ctx.createSubcontext("foo");
         fail("Second createSubcontext(foo) against HA-JNDI did NOT fail");
      }
      catch (javax.naming.NameAlreadyBoundException e)
      {
         getLog().debug("Second createSubcontext(foo) against HA-JNDI failed as expected");
View Full Code Here


      {
         getLog().debug("Second createSubcontext(foo) against HA-JNDI failed as expected");
      }

      getLog().debug("binding foo/bar");
      ctx.createSubcontext("foo/bar");

      getLog().debug("unbinding foo/bar");
      ctx.unbind("foo/bar");

      getLog().debug("unbinding foo");
View Full Code Here

      redeployNaming();
     
      Context ctx2 = new InitialContext(env);
      try
      {
         Context sub = ctx2.createSubcontext(SUBCONTEXT_NAME);
         sub.bind(BIND_NAME, BIND_VALUE);
         assertEquals("Proper bind to " + SUBCONTEXT_NAME, BIND_VALUE, sub.lookup(BIND_NAME));
      }
      catch (NamingException e)
      {
View Full Code Here

      Properties env = new Properties();
      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.setProperty(Context.PROVIDER_URL, "jnp://localhost:10999/");
      env.setProperty("jnp.disableDiscovery", "true");
      InitialContext ctx = new InitialContext(env);
      ctx.createSubcontext("foo");
      try
      {
         ctx.createSubcontext("foo");
         fail("Second createSubcontext(foo) did NOT fail");
      }
View Full Code Here

      env.setProperty("jnp.disableDiscovery", "true");
      InitialContext ctx = new InitialContext(env);
      ctx.createSubcontext("foo");
      try
      {
         ctx.createSubcontext("foo");
         fail("Second createSubcontext(foo) did NOT fail");
      }
      catch (NameAlreadyBoundException e)
      {
         getLog().debug("Second createSubcontext(foo) failed as expected");
View Full Code Here

      }
      catch (NameAlreadyBoundException e)
      {
         getLog().debug("Second createSubcontext(foo) failed as expected");
      }
      ctx.createSubcontext("foo/bar");
      ctx.unbind("foo/bar");
      ctx.unbind("foo");
   }

   /** Lookup a name to test basic connectivity and lookup of a known name
View Full Code Here

         bootCtx.unbind("readonly");
      }
      catch(NamingException ignore)
      {
      }
      Context readonly = bootCtx.createSubcontext("readonly");
      readonly.bind("data", "somedata");

      Properties env = new Properties();
      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
      env.setProperty(Context.PROVIDER_URL, INVOKER_BASE + "ReadOnlyJNDIFactory");
View Full Code Here

      }
      catch(NamingException ignore)
      {
      }
      getLog().debug("Creating readonly context");
      bootCtx.createSubcontext("readonly");
      bootCtx.bind("readonly/data", "somedata");

      // Test access through the readonly proxy
      env.setProperty("bootstrap-binding", "naming/ReadOnlyNaming");
      getLog().debug("Creating InitialContext with env="+env);
View Full Code Here

      Attribute callByValue = new Attribute("CallByValue", Boolean.TRUE);
      server.setAttribute(namingService, callByValue);
      System.out.println("NamingService.CallByValue set to true");

      InitialContext ctx = new InitialContext();
      Context testCtx = ctx.createSubcontext("shared-context");
      System.out.println("Created shared-context");
      testCtx.bind("KeyCount", new Integer(names.length));
      System.out.println("Bound KeyCount");
      for(int n = 0; n < names.length; n ++)
      {
View Full Code Here

    */
   public void testCreateSubcontext() throws Exception
   {
      log.debug("+++ testCreateSubcontext");
      InitialContext ctx = getInitialContext();
      ctx.createSubcontext("foo");
      try
      {
         ctx.createSubcontext("foo");
         fail("Second createSubcontext(foo) did NOT fail");
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.