Package javax.naming

Examples of javax.naming.Context.createSubcontext()


                        // Add all of the subcontexts in the fname
                        while (subContextNameEnum.hasMoreElements()) {
                            final String subContextName = subContextNameEnum.nextElement();
                            if (subContextNameEnum.hasMoreElements()) {
                                // Bind a new sub context if the current name component is not the leaf
                                nextContext = nextContext.createSubcontext(subContextName);
                            }
                            else {
                                nextContext.rebind(subContextName, instanceId.getNodeValue());
                               
                                if (this.logger.isDebugEnabled()) {
View Full Code Here


                        "'" + subname + "' is already bound");
                } else {
                    subcontext = (Context) object;
                }
            } catch (NameNotFoundException exception) {
                subcontext = subcontext.createSubcontext(component);
            }
        }

        component = composite.get(composite.size() - 1);
        if (component.length() == 0) {
View Full Code Here

    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();
   
    // create subcontext
    return ctx.createSubcontext(rname);
  }

  /**
   * Retrieves the named object, following links except
   * for the terminal atomic component of the name.
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

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

            try {
                lastContext = lastContext.createSubcontext(part);
            } catch (NamingException e) {
                try {
                    lastContext = (Context) lastContext.lookup(part);
                } catch (NamingException e1) {
                    return lastContext;
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

      Name name = ictx.getNameParser( jndiName ).parse( jndiName );
      Context ctx = ictx;
      for (int i = 0, max = name.size() - 1; i < max; i++)
      {
    try
    { ctx = ctx.createSubcontext( name.get( i ) ); }
    catch (NameAlreadyBoundException ignore)
    { ctx = (Context) ctx.lookup( name.get( i ) ); }
      }

       ictx.rebind( jndiName, combods );
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);
        }
        // unbind name just in case
        try {
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

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.