Package javax.naming

Examples of javax.naming.Context.createSubcontext()


         {
            fromCtx = (Context) fromCtx.lookup(comp);
         }
         catch(NameNotFoundException e)
         {
            fromCtx = fromCtx.createSubcontext(comp);
         }
      }

      log.debug("atom: " + atom);
      log.debug("link: " + link);
View Full Code Here


         }
         catch (NameNotFoundException e)
         {
            // OK
         }
         crtContext = crtContext.createSubcontext(tok);
      }
      return crtContext;
   }

   public static void tearDownRecursively(final Context c) throws Exception
View Full Code Here

         }
         catch(NameNotFoundException e)
         {
            // OK
         }
         crtContext = crtContext.createSubcontext(tok);
      }
      return crtContext;
   }

   public static void tearDownRecursively(Context c) throws Exception
View Full Code Here

        }
        final Context namespaceContext = selector.getContext(parsedName.namespace());
        if (namespaceContext == null) {
            throw new NameNotFoundException(name.toString());
        }
        return namespaceContext.createSubcontext(parsedName.remaining());
    }

    private interface ParsedName {
        String namespace();
View Full Code Here

      JNDIUtils.createSubcontexts( servicesContext, serviceName );

      try
      {
         newContext = new NamingContext( servicesContext.createSubcontext( serviceName ),
                                         this.engine );
         LOG.debug( "Created new subcontext with name: " + serviceName );
      }
      catch ( Exception e )
      {
View Full Code Here

      catch ( NameNotFoundException e )
      {
         LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_NAME_BASE);
         compContext = result.createSubcontext( JndiConstants.CONTEXT_NAME_BASE );
         LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_SERVICES_BASE);
         compContext.createSubcontext( JndiConstants.CONTEXT_SERVICES_BASE );
          LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_GLOBAL_BASE);
         compContext.createSubcontext( JndiConstants.CONTEXT_GLOBAL_BASE );
      }

      return result;
View Full Code Here

         LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_NAME_BASE);
         compContext = result.createSubcontext( JndiConstants.CONTEXT_NAME_BASE );
         LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_SERVICES_BASE);
         compContext.createSubcontext( JndiConstants.CONTEXT_SERVICES_BASE );
          LOG.debug("Creating SubContext: " + JndiConstants.CONTEXT_GLOBAL_BASE);
         compContext.createSubcontext( JndiConstants.CONTEXT_GLOBAL_BASE );
      }

      return result;
   }
View Full Code Here

            result.lookup("java:comp/env");
        }
        catch(NameNotFoundException e)
        {
            compContext = result.createSubcontext("comp");
            compContext.createSubcontext("env");
        }
        return result;
    }

    /**
 
View Full Code Here

      Context envCtx;
          try {
            envCtx = (Context) iniCtx.lookup("java:comp/env");
          } catch (NamingException e) {
            envCtx = (Context) iniCtx.lookup("java:comp");
            envCtx = envCtx.createSubcontext("env");
          }
         
          String securityDomain = getConfig().getAttribute(SECURITY_DOMAIN);
          Util.bind(envCtx, "security/securityMgr", new LinkRef(securityDomain));
          Util.bind(envCtx, "security/realmMapping", new LinkRef(securityDomain));
View Full Code Here

          throws NamingException {
        String[] tokens = parseString(name);
        Context startingContext = getInitialContext();
        for (int i = 0; i < tokens.length - 1; i++) {
            try {
                startingContext.createSubcontext(tokens[i]);
            } catch (NameAlreadyBoundException nab) {
            }
        }
        startingContext.bind(name, obj);
    }
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.