Package javax.naming

Examples of javax.naming.Context.createSubcontext()


        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

            if (++i == parts.length) {
                return lastContext;
            }

            try {
                lastContext = lastContext.createSubcontext(part);
            } catch (final NamingException e) {
                try {
                    lastContext = (Context) lastContext.lookup(part);
                } catch (final NamingException e1) {
                    return lastContext;
View Full Code Here

        configurationManager.loadConfiguration(configurationData);
        configurationManager.startConfiguration(configurationData.getId());

        InitialContext ctx = new InitialContext(contextEnv);
        Context fooCtx = ctx.createSubcontext("jca:foo");
        fooCtx.createSubcontext("bar");
        ctx.bind("jca:foo/bar/baz", 1);
        assertEquals(ctx.lookup("jca:foo/bar/baz"), 1);
        ctx.rebind("jca:foo/bar/baz", 2);
        assertEquals(ctx.lookup("jca:foo/bar/baz"), 2);
View Full Code Here

     * 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

            // create intermediate contexts
            for (int i = 1; i < parsedName.size(); i++) {
                Name contextName = parsedName.getPrefix(i);
                if (!bindingExists(context, contextName)) {
                    context.createSubcontext(contextName);
                }
            }

            // bind
            context.bind(jndiName, value);
View Full Code Here

        configurationManager.loadConfiguration(configurationData);
        configurationManager.startConfiguration(configurationData.getId());

        InitialContext ctx = new InitialContext(contextEnv);
        Context fooCtx = ctx.createSubcontext("jca:foo");
        fooCtx.createSubcontext("bar");
        ctx.bind("jca:foo/bar/baz", 1);
        assertEquals(ctx.lookup("jca:foo/bar/baz"), 1);
        ctx.rebind("jca:foo/bar/baz", 2);
        assertEquals(ctx.lookup("jca:foo/bar/baz"), 2);
View Full Code Here

     * 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

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.