Package javax.naming

Examples of javax.naming.Context.destroySubcontext()


            final ParsedName parsedName = parse(name);
            final Context namespaceContext = findContext(name, parsedName);
            if (namespaceContext == null)
                super.destroySubcontext(parsedName.remaining());
            else
                namespaceContext.destroySubcontext(parsedName.remaining());
        }

        public Context createSubcontext(Name name) throws NamingException {
            final ParsedName parsedName = parse(name);
            final Context namespaceContext = findContext(name, parsedName);
View Full Code Here


        ContextFactory.associateClassLoader(context.getClassLoader());
        try
        {
            Context ic = new InitialContext();
            Context compCtx =  (Context)ic.lookup ("java:comp");
            compCtx.destroySubcontext("env");

            //unbind any NamingEntries that were configured in this webapp's name space
            @SuppressWarnings("unchecked")
            List<Bound> bindings = (List<Bound>)context.getAttribute(JETTY_ENV_BINDINGS);
            context.setAttribute(JETTY_ENV_BINDINGS,null);
View Full Code Here

    {
        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(context.getClassLoader());
        Context ic = new InitialContext();
        Context compCtx =  (Context)ic.lookup ("java:comp");
        compCtx.destroySubcontext("env");
        Thread.currentThread().setContextClassLoader(oldLoader);
    }

    @Test
    public void testMissingResourceDeclaration()
View Full Code Here

    public void destroy() throws Exception
    {
        classNames.clear();
        InitialContext ic = new InitialContext();
        Context comp = (Context)ic.lookup("java:comp");
        comp.destroySubcontext("env");
    }

    @Test
    public void testParseClassNames() throws Exception
    {
View Full Code Here

        }
        finally
        {
            InitialContext ic = new InitialContext();
            Context java = (Context)ic.lookup("java:");
            java.destroySubcontext("fee");
            currentThread.setContextClassLoader(currentLoader);
        }
    }
   
   
View Full Code Here

        finally
        {
            //make some effort to clean up
            InitialContext ic = new InitialContext();
            Context java = (Context)ic.lookup("java:");
            java.destroySubcontext("zero");
            java.destroySubcontext("fee");
            currentThread.setContextClassLoader(childLoader1);
            Context comp = (Context)ic.lookup("java:comp");
            comp.destroySubcontext("env");
            comp.unbind("crud");
View Full Code Here

        {
            //make some effort to clean up
            InitialContext ic = new InitialContext();
            Context java = (Context)ic.lookup("java:");
            java.destroySubcontext("zero");
            java.destroySubcontext("fee");
            currentThread.setContextClassLoader(childLoader1);
            Context comp = (Context)ic.lookup("java:comp");
            comp.destroySubcontext("env");
            comp.unbind("crud");
            comp.unbind("crud2");
View Full Code Here

            Context java = (Context)ic.lookup("java:");
            java.destroySubcontext("zero");
            java.destroySubcontext("fee");
            currentThread.setContextClassLoader(childLoader1);
            Context comp = (Context)ic.lookup("java:comp");
            comp.destroySubcontext("env");
            comp.unbind("crud");
            comp.unbind("crud2");
            currentThread.setContextClassLoader(currentLoader);
        }
    }
View Full Code Here

  /**  
         * Destroys the named context and removes it from the namespace.
         */  
  public void destroySubcontext(Name name) throws NamingException {
    Context ctx = getImpl();
    ctx.destroySubcontext(name);
  }
         
  /**  
         * Destroys the named context and removes it from the namespace.
View Full Code Here

  /**  
         * Destroys the named context and removes it from the namespace.
         */  
   public void destroySubcontext(String name) throws NamingException {
    Context ctx = getImpl();
    ctx.destroySubcontext(name);
  }
         
  /**  
         * Retrieves the environment in effect for this context.
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.