Package javax.naming

Examples of javax.naming.Context.createSubcontext()


      }
      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


        ContextFactory.associateClassLoader(wac.getClassLoader());
        try
        {
            Context context = new InitialContext();
            Context compCtx =  (Context)context.lookup ("java:comp");
            compCtx.createSubcontext("env");
        }
        finally
        {
            ContextFactory.disassociateClassLoader();
            Thread.currentThread().setContextClassLoader(old_loader);
View Full Code Here

        context.setClassLoader(new WebAppClassLoader(Thread.currentThread().getContextClassLoader(), context));
        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(context.getClassLoader());
        Context icontext = new InitialContext();
        Context compCtx =  (Context)icontext.lookup ("java:comp");
        compCtx.createSubcontext("env");
        Thread.currentThread().setContextClassLoader(oldLoader);

        org.eclipse.jetty.plus.jndi.Resource ds = new org.eclipse.jetty.plus.jndi.Resource (context, "jdbc/mydatasource", new Object());

        URL webXml = Thread.currentThread().getContextClassLoader().getResource("web.xml");
View Full Code Here

                if(__log.isDebugEnabled())
                    __log.debug("Subcontext "+name.get(i)+" already exists");
            }
            catch (NameNotFoundException e)
            {
                subCtx = subCtx.createSubcontext(name.get(i));
                if(__log.isDebugEnabled())
                    __log.debug("Subcontext "+name.get(i)+" created");
            }
        }
View Full Code Here

    while (n.size() > 1) {
      String ctxName = n.get(0);
      try {
        ctx = (Context) ctx.lookup(ctxName);
      } catch (NameNotFoundException e) {
        ctx = ctx.createSubcontext(ctxName);
      }
      n = n.getSuffix(1);
    }

    ctx.bind(n.get(0), obj);
View Full Code Here

    while (n.size() > 1) {
      String ctxName = n.get(0);
      try {
        ctx = (Context) ctx.lookup(ctxName);
      } catch (NameNotFoundException e) {
        ctx = ctx.createSubcontext(ctxName);
      }
      n = n.getSuffix(1);
    }

    ctx.bind(n.get(0), obj);
View Full Code Here

         for(int i=0; i<size && enom.hasMoreElements(); i++) {
           String nmpart = (String) enom.nextElement();
           try {
             ct = (Context) ct.lookup(nmpart);
           } catch(NameNotFoundException ex) {
             ct = ct.createSubcontext(nmpart);
           }
         }
    }

    // get data for name
View Full Code Here

        if (name.size() == 1) {
            return createSubcontext(name.get(0));
        }
        Context context = getContinuationContext(name);
        try {
            return context.createSubcontext(name.getSuffix(1));
        } finally {
            context.close();
        }
    }
View Full Code Here

    public Context createSubcontext(String name) throws NamingException {
        ResolveResult result = getRootURLContext(name, environment);
        Context context = (Context) result.getResolvedObj();

        try {
            return context.createSubcontext(result.getRemainingName());
        } finally {
            context.close();
        }
    }
View Full Code Here

        if (name.size() == 1) {
            return createSubcontext(name.get(0));
        }
        Context context = getContinuationContext(name);
        try {
            return context.createSubcontext(name.getSuffix(1));
        } finally {
            context.close();
        }
    }
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.