Package javax.naming

Examples of javax.naming.Context.createSubcontext()


     * Add operation control to test if normal add operations occur correctly.
     */
    public void testAddControl() throws NamingException
    {
        Context ctx = sysRoot.createSubcontext( "ou=blah" );
        ctx.createSubcontext( "ou=subctx" );
        Object obj = sysRoot.lookup( "ou=subctx,ou=blah" );
        assertNotNull( obj );
    }


View Full Code Here


     * Tests for delete failure when the entry to be deleted has child entires.
     */
    public void testFailDeleteNotAllowedOnNonLeaf() throws NamingException
    {
        Context ctx = sysRoot.createSubcontext( "ou=blah" );
        ctx.createSubcontext( "ou=subctx" );

        try
        {
            sysRoot.destroySubcontext( "ou=blah" );
            fail( "Execution should never get here due to exception!" );
View Full Code Here

        Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "tyrex.naming.MemoryContextFactory");
        rootJNDIContext = new MemoryContext(null);
        rootJNDIContext.createSubcontext("jdbc");
        ctx = rootJNDIContext.createSubcontext("comp");
        ctx = ctx.createSubcontext("env");
        ctx = ctx.createSubcontext("jdbc");

        //  Associate the memory context with a new
        //  runtime context and associate the runtime context
        //  with the current thread
View Full Code Here

        env.put(Context.INITIAL_CONTEXT_FACTORY, "tyrex.naming.MemoryContextFactory");
        rootJNDIContext = new MemoryContext(null);
        rootJNDIContext.createSubcontext("jdbc");
        ctx = rootJNDIContext.createSubcontext("comp");
        ctx = ctx.createSubcontext("env");
        ctx = ctx.createSubcontext("jdbc");

        //  Associate the memory context with a new
        //  runtime context and associate the runtime context
        //  with the current thread
        bindToCurrentThread();
View Full Code Here

      }
      catch (CannotProceedException cpe)
      {
         cpe.setEnvironment(refEnv);
         Context cctx = NamingManager.getContinuationContext(cpe);
         return cctx.createSubcontext(cpe.getRemainingName());
      }
      catch (IOException e)
      {
         naming = null;
         removeServer(refEnv);
View Full Code Here

      }
      catch (NamingException e) {
        log.info("Could not read context " + RESOURCES_CONTEXT + ": Trying to create it!");
        try {
          Context compCtx = (Context) ctx.lookup("java:comp");
          compCtx.createSubcontext("env");
        }
        catch (Exception ex) {
          log.error("Could not create context:" + RESOURCES_CONTEXT);
        }
      }
View Full Code Here

            context.lookup(subcontextName);
         }
         catch (NameNotFoundException e)
         {
            logger.trace("Creating subcontext " + subcontextName);
            context.createSubcontext(subcontextName);
         }
      }
     
      NonSerializableFactory.rebind(context, jndiName, value);
   }
View Full Code Here

      }
      catch (CannotProceedException cpe)
      {
         cpe.setEnvironment(refEnv);
         Context cctx = NamingManager.getContinuationContext(cpe);
         return cctx.createSubcontext(cpe.getRemainingName());
      }
      catch (IOException e)
      {
         naming = null;
         removeServer(refEnv);
View Full Code Here

                }
            } catch (NamingException e) {
                WeldServletLogger.LOG.couldNotReadContext(RESOURCES_CONTEXT);
                try {
                    Context compCtx = (Context) ctx.lookup("java:comp");
                    compCtx.createSubcontext("env");
                } catch (Exception ex) {
                    WeldServletLogger.LOG.couldntCreateContext(RESOURCES_CONTEXT);
                }
            }
View Full Code Here

      }
      catch (CannotProceedException cpe)
      {
         cpe.setEnvironment(refEnv);
         Context cctx = NamingManager.getContinuationContext(cpe);
         return cctx.createSubcontext(cpe.getRemainingName());
      }
      catch (IOException e)
      {
         naming = null;
         removeServer(refEnv);
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.