Examples of CompositeName


Examples of javax.naming.CompositeName

        contextManager.getRootNamingContext();
      if (rootNc == null) {
        rootNc = contextManager.newNamingContext(
            serverId,
            null,
            new CompositeName());
      }
    }
  }
View Full Code Here

Examples of javax.naming.CompositeName

        path + ',' + subcontextOwnerId + ')');

    // The root already exists.
    if (path.size() == 0) throw new NameAlreadyBoundException();

    CompositeName parentPath = (CompositeName)path.clone();   
    String lastName =
      (String)parentPath.remove(parentPath.size() - 1);
    NamingContext parentNc =
      contextManager.getNamingContext(parentPath);

    NamingContextId ncid = createSubcontext(
      parentNc, lastName, path, null,
View Full Code Here

Examples of javax.naming.CompositeName

                       path + ')');

    if (path.size() == 0)
      throw new NamingException("Cannot delete root context.");

    CompositeName parentPath = (CompositeName)path.clone();
    String lastName = (String)parentPath.remove(parentPath.size() - 1);
    NamingContext parentNc = contextManager.getNamingContext(parentPath);
   
    try {
      NamingContext nc = contextManager.getNamingContext(path);
      if (nc.size() > 0) {
View Full Code Here

Examples of javax.naming.CompositeName

                                                                        evt.getPath(),
                                                                        evt.getContextId(),
                                                                        evt.getOwnerId(),
                                                                        from);
    }else{
      CompositeName parentPath = (CompositeName) evt.getPath().clone();   
      parentPath.remove(parentPath.size() - 1);
      NamingContext  nc= getServerImpl().getNamingContext(parentPath);
      getServerImpl().createSubcontext(nc,
                                       evt.getName(),
                                       evt.getPath(),
                                       evt.getContextId(),
View Full Code Here

Examples of javax.naming.CompositeName

                                                                         evt.getUpdatedContextId()),
                                                                         evt.getName(),
                                                                         evt.getPath(),
                                                                         from);
    }else{
      CompositeName parentPath = (CompositeName) evt.getPath().clone();   
      parentPath.remove(parentPath.size() - 1);
      NamingContext  nc= getServerImpl().getNamingContext(parentPath);
      getServerImpl().destroySubcontext(
                                        nc,
                                        evt.getName(),
                                        evt.getPath(),
View Full Code Here

Examples of javax.naming.CompositeName

            Record record =(RecordenumRecord.nextElement();
            Record r = nc.getRecord(record.getName());
            if (r == null
              nc.addRecord(record);
            if(record instanceof ContextRecord){
              CompositeName parentPath = contexts[i].getCompositeName();
              record_compositeName.put(record,parentPath);
            }
          }
          composite_context.put(contexts[i].getCompositeName(),nc);
        }
      }
      if(looseCoupling){
        Enumeration enumKeyRecord = record_compositeName.keys();
        while(enumKeyRecord.hasMoreElements()) {
          Record recor =(Record)enumKeyRecord.nextElement();
          CompositeName cn =(CompositeName)((CompositeName)(record_compositeName.get(recor))).clone();
          cn.add(recor.getName());
          if(composite_context.containsKey(cn)){
            NamingContext nc  =(NamingContext)composite_context.get(cn);
            ((ContextRecord)recor).setId(nc.getId());
          }       
        }
        Enumeration enumContext = composite_context.elements();
        while(enumContext.hasMoreElements()) {
          NamingContext nc  =(NamingContext)enumContext.nextElement();
          getServerImpl().storeNamingContext(nc);
        }
      }



      Vector retryNames = new Vector();
      Vector retryLists = new Vector();
      Enumeration names = initRequestContextLists.keys();
      Enumeration lists = initRequestContextLists.elements();
      while (lists.hasMoreElements()) {
        CompositeName name =
          (CompositeName)names.nextElement();
        RequestContextList ctxList =
          (RequestContextList)lists.nextElement();
        boolean retry = false;
        for (int i = 0; i < newNames.size(); i++) {
          CompositeName newName =
            (CompositeName)newNames.elementAt(i);
          if (name.startsWith(newName)) {
            retry = true;
            break;
          }
        }
        if (retry) {
          retryNames.addElement(name);
          retryLists.addElement(ctxList);
        }
      }

      for (int i = 0; i < retryNames.size(); i++) {
        CompositeName name =
          (CompositeName)retryNames.elementAt(i);
        RequestContextList ctxList =
          (RequestContextList)retryLists.elementAt(i);
        initRequestContextLists.remove(name);
        while (ctxList.getSize() > 0) {
View Full Code Here

Examples of javax.naming.CompositeName

                                      RequestContext reqCtx) {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG,
                       "ReplicationManager.onMissingRecord(" +
                       mre + ',' + reqCtx + ')');
    CompositeName resolvedName =
      (CompositeName)mre.getNameNotFoundException().getResolvedName();
    if (mre.getOwnerId().equals(getId()) ||
        resolvedName.equals(reqCtx.getResolvedName())) {
      // The resolved context has already been updated.
      return new JndiError(mre.getNameNotFoundException());
    }

    reqCtx.setResolvedName(resolvedName);
View Full Code Here

Examples of javax.naming.CompositeName

        try {
            InitialContext ic = new InitialContext();
            for (Iterator i = this.objectsToCreate.keySet().iterator(); i.hasNext();) {
                String name = (String) i.next();
                try {
                    Name fullName = new CompositeName(name);
                    Context currentContext = ic;
                    while (fullName.size() > 1) {
                        // Make contexts that are not already present
                        try {
                            currentContext = currentContext
                                    .createSubcontext(fullName.get(0));
                        } catch (NamingException err) {
                            currentContext = (Context) currentContext
                                    .lookup(fullName.get(0));
                        }
                        fullName = fullName.getSuffix(1);
                    }
                    ic.bind(name, this.objectsToCreate.get(name));
                    Logger.log(Logger.FULL_DEBUG, JNDI_RESOURCES,
                            "ContainerJNDIManager.BoundResource", name);
                } catch (NamingException err) {
View Full Code Here

Examples of javax.naming.CompositeName

                    throw new NameNotFoundException(ContainerJNDIManager.JNDI_RESOURCES.getString(
                            "WinstoneContext.NameNotFound", name.toString()));

                try {
                    return NamingManager.getObjectInstance(thisValue,
                            new CompositeName().add(thisName), this,
                            this.environment);
                } catch (Exception e) {
                    NamingException ne = new NamingException(ContainerJNDIManager.JNDI_RESOURCES
                            .getString("WinstoneContext.FailedToGetInstance"));
                    ne.setRootCause(e);
View Full Code Here

Examples of javax.naming.CompositeName

                }
        }
    }

    public Object lookup(String name) throws NamingException {
        return lookup(new CompositeName(name));
    }
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.