Package javax.naming

Examples of javax.naming.CompositeName


      Trace.logger.log(
        BasicLevel.DEBUG,
        "HANamingContextFactory.getInitialContext(" + env + ')');
    return new fr.dyade.aaa.jndi2.client.NamingContextImpl(
      getNamingConnection(env),
      new CompositeName());   
  }
View Full Code Here


    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG,
                       "NamingContextFactory.getInitialContext(" + env + ')');

    return new NamingContextImpl(getNamingConnection(env),
                                 new CompositeName());   
  }
View Full Code Here

  }

  /** Empty constructor, called by the subclass. */
  protected NamingContextImpl()
  {
    contextPath = new CompositeName();
  }
View Full Code Here

  public Object lookup(String name) throws NamingException {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.lookup(" +
                       name + ')');
    CompositeName path = merge(contextPath, name);
    JndiReply reply = connection.invoke(new LookupRequest(path));
    if (reply instanceof JndiError) {
      NamingException exc = ((JndiError)reply).getException();
      exc.fillInStackTrace();
      throw exc;
View Full Code Here

  public NamingEnumeration listBindings(String name) throws NamingException {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.listBindings(" + name + ')');
   
    CompositeName queryPath = merge(contextPath, name);
    JndiReply reply = connection.invoke(new ListBindingsRequest(queryPath));
    if (reply instanceof JndiError) {
      NamingException exc = ((JndiError)reply).getException();
      exc.fillInStackTrace();
      throw exc;
    }
   
    ListBindingsReply lbr = (ListBindingsReply)reply;

    // 1- resolve contexts
    Binding[] bindings = lbr.getContexts();
    for (int i = 0; i < bindings.length; i++) {
      CompositeName subCtxPath = (CompositeName)queryPath.clone();
      subCtxPath.add(bindings[i].getName());
      bindings[i].setObject(new NamingContextImpl(
        connection.cloneConnection(), subCtxPath));
    }

    // 2- resolve references
View Full Code Here

  public Context createSubcontext(String name) throws NamingException {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.createSubcontext(" +
                       name + ')');
    CompositeName path = merge(contextPath, name);
    JndiReply reply = connection.invoke(
      new CreateSubcontextRequest(path));   
    if (reply instanceof JndiError) {
      NamingException exc = ((JndiError)reply).getException();
      exc.fillInStackTrace();
View Full Code Here

    throw(new NamingException("Not yet available"));
  }

  private static CompositeName merge(CompositeName path, String name) throws NamingException {   
    if (name == null) throw new InvalidNameException();
    CompositeName res = new CompositeName(name);
    trim(res);
    for (int i = path.size() - 1; i > -1 ; i--) {
      res.add(0, path.get(i));
    }
    return res;
  }
View Full Code Here

    if (!strOwnerId.equals(ownerId.toString()))
      sendTo(new ChangeOwnerRequest((CompositeName) contextName.clone(), strOwnerId));
  }

  public void createSubcontext(String ctxName) throws NamingException {
    CompositeName cn = (CompositeName) contextName.clone();
    if (contextName != null)
      cn.add(ctxName);
    else
      cn = getCompositeName(ctxName);
    sendTo(new CreateSubcontextRequest(cn));
  }
View Full Code Here

      return rec.toString();
    return null;
  }

  public void unbind(String name) throws NamingException {
    CompositeName cn = (CompositeName) contextName.clone();
    if (contextName != null)
      cn.add(name);
    else
      cn = getCompositeName(name);
    sendTo(new UnbindRequest(cn));
  }
View Full Code Here

    sendTo(new UnbindRequest(cn));
  }
 
  private CompositeName getCompositeName(String path) throws InvalidNameException {
    if (path.startsWith("/"))
      return new CompositeName(path.substring(1, path.length()));
    return new CompositeName(path);
  }
View Full Code Here

TOP

Related Classes of javax.naming.CompositeName

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.