Package com.toc.jndp.interfaces

Examples of com.toc.jndp.interfaces.NamingContext


    //Clone the JNDI Environment
    Hashtable<String, Object> env = (Hashtable<String, Object>)environment.clone();
    //Parser the JNDP URL and Configure the Environment
    String providerURL = (String)environment.get(KEY_JAVA_PROVIDER_URL_ENV);
    Name prefix = parserURL(providerURL, env);
    return new NamingContext(env, prefix, null);
  }
View Full Code Here


      }
      Name fullName = (Name)this.prefix.clone();
      fullName = fullName.addAll(name);
      NamingServer subContext = new NamingServer(fullName, this);
      setBinding(name, subContext);
      newSubCtx = new NamingContext(null, fullName, this.getRoot());
    }
    return newSubCtx;
  }
View Full Code Here

        try {
          Binding b = getBinding(key,credence);
          if (b.getObject() instanceof NamingServer) {
            Name n = (Name)this.prefix.clone();
            n.add(b.getName());
            list.add(new Binding(b.getName(), b.getClassName(), new NamingContext(null, n, getRoot())));
          } else {
            list.add(b);
          }
        } catch(SecurityVerifyException sve) {
        }
View Full Code Here

  @Override
  public Object lookup(Name name, Credence credence) throws NamingException,
      RemoteException {
    Object result = null;
    if(name.isEmpty()) {
      result = new NamingContext(null, (Name)(Name)this.prefix.clone(), getRoot());
    } else {
      if(name.size() > 1) {
        Object ctx = getObject(name, credence);
        if(ctx instanceof NamingServer) {
          result = ((NamingServer)ctx).lookup(name.getSuffix(1), credence);
        } else if(ctx instanceof Reference) {
          result = new ResolveResult(ctx, name.getSuffix(1));
        } else {
          throw new NotContextException();
        }
      } else {
        if (name.get(0).equals("")) {
          result = new NamingContext(null, (Name)(Name)this.prefix.clone(), getRoot());
        } else {
          Object res = getObject(name, credence);
          if (res instanceof NamingServer) {
            Name fullName = (Name)(Name)this.prefix.clone();
            fullName.addAll(name);
            result = new NamingContext(null, fullName, getRoot());
          } else {
            result = res;
          }
        }
      }
View Full Code Here

TOP

Related Classes of com.toc.jndp.interfaces.NamingContext

Copyright © 2018 www.massapicom. 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.