org.apache.naming.resources.WARDirContext.treeLookup()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(15.3k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.apache.naming.resources.WARDirContext.treeLookup()方法的一些代码示例,展示了WARDirContext.treeLookup()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WARDirContext.treeLookup()方法的具体详情如下:
包路径:org.apache.naming.resources.WARDirContext
类名称:WARDirContext
方法名:treeLookup

WARDirContext.treeLookup介绍

[英]Entry tree lookup.
[中]条目树查找。

代码示例

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Enumerates the names bound in the named context, along with the 
 * objects bound to them. The contents of any subcontexts are not 
 * included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param name the name of the context to list
 * @return an enumeration of the bindings in this context. 
 * Each element of the enumeration is of type Binding.
 * @exception NamingException if a naming exception is encountered
 */
public NamingEnumeration listBindings(Name name)
  throws NamingException {
  if (name.isEmpty())
    return new NamingContextBindingsEnumeration(list(entries).iterator(),
        this);
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NamingException
      (MESSAGES.resourceNotFound(name.toString()));
  return new NamingContextBindingsEnumeration(list(entry).iterator(),
      this);
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Enumerates the names bound in the named context, along with the class 
 * names of objects bound to them. The contents of any subcontexts are 
 * not included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param name the name of the context to list
 * @return an enumeration of the names and class names of the bindings in 
 * this context. Each element of the enumeration is of type NameClassPair.
 * @exception NamingException if a naming exception is encountered
 */
public NamingEnumeration list(Name name)
  throws NamingException {
  if (name.isEmpty())
    return new NamingContextEnumeration(list(entries).iterator());
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NamingException
      (MESSAGES.resourceNotFound(name.toString()));
  return new NamingContextEnumeration(list(entry).iterator());
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Enumerates the names bound in the named context, along with the class 
 * names of objects bound to them. The contents of any subcontexts are 
 * not included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param name the name of the context to list
 * @return an enumeration of the names and class names of the bindings in 
 * this context. Each element of the enumeration is of type NameClassPair.
 * @exception NamingException if a naming exception is encountered
 */
public NamingEnumeration list(Name name)
  throws NamingException {
  if (name.isEmpty())
    return new NamingContextEnumeration(list(entries).iterator());
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NamingException
      (sm.getString("resources.notFound", name));
  return new NamingContextEnumeration(list(entry).iterator());
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Retrieves the named object. If name is empty, returns a new instance 
 * of this context (which represents the same naming context as this 
 * context, but its environment may be modified independently and it may 
 * be accessed concurrently).
 * 
 * @param name the name of the object to look up
 * @return the object bound to name
 * @exception NamingException if a naming exception is encountered
 */
public Object lookup(Name name)
  throws NamingException {
  if (name.isEmpty())
    return this;
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NamingException
      (MESSAGES.resourceNotFound(name.toString()));
  ZipEntry zipEntry = entry.getEntry();
  if (zipEntry.isDirectory())
    return new WARDirContext(base, entry);
  else
    return new WARResource(entry.getEntry());
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Enumerates the names bound in the named context, along with the 
 * objects bound to them. The contents of any subcontexts are not 
 * included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param name the name of the context to list
 * @return an enumeration of the bindings in this context. 
 * Each element of the enumeration is of type Binding.
 * @exception NamingException if a naming exception is encountered
 */
public NamingEnumeration listBindings(Name name)
  throws NamingException {
  if (name.isEmpty())
    return new NamingContextBindingsEnumeration(list(entries).iterator(),
        this);
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NamingException
      (sm.getString("resources.notFound", name));
  return new NamingContextBindingsEnumeration(list(entry).iterator(),
      this);
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Retrieves the named object. If name is empty, returns a new instance 
 * of this context (which represents the same naming context as this 
 * context, but its environment may be modified independently and it may 
 * be accessed concurrently).
 * 
 * @param name the name of the object to look up
 * @return the object bound to name
 * @exception NamingException if a naming exception is encountered
 */
public Object lookup(Name name)
  throws NamingException {
  if (name.isEmpty())
    return this;
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NamingException
      (sm.getString("resources.notFound", name));
  ZipEntry zipEntry = entry.getEntry();
  if (zipEntry.isDirectory())
    return new WARDirContext(base, entry);
  else
    return new WARResource(entry.getEntry());
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Enumerates the names bound in the named context, along with the 
 * objects bound to them. The contents of any subcontexts are not 
 * included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param strName the name of the context to list
 * @return an enumeration of the bindings in this context. 
 * Each element of the enumeration is of type Binding.
 * @exception NamingException if a naming exception is encountered
 */
@Override
protected NamingEnumeration<Binding> doListBindings(String strName)
  throws NamingException {
  
  Name name = getEscapedJndiName(strName);
  if (name.isEmpty())
    return new NamingContextBindingsEnumeration(list(entries).iterator(),
        this);
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
  
  return new NamingContextBindingsEnumeration(list(entry).iterator(),
      this);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Enumerates the names bound in the named context, along with the 
 * objects bound to them. The contents of any subcontexts are not 
 * included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param strName the name of the context to list
 * @return an enumeration of the bindings in this context. 
 * Each element of the enumeration is of type Binding.
 * @exception NamingException if a naming exception is encountered
 */
@Override
protected NamingEnumeration<Binding> doListBindings(String strName)
  throws NamingException {
  
  Name name = getEscapedJndiName(strName);
  if (name.isEmpty())
    return new NamingContextBindingsEnumeration(list(entries).iterator(),
        this);
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
  
  return new NamingContextBindingsEnumeration(list(entry).iterator(),
      this);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Enumerates the names bound in the named context, along with the 
 * objects bound to them. The contents of any subcontexts are not 
 * included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param strName the name of the context to list
 * @return an enumeration of the bindings in this context. 
 * Each element of the enumeration is of type Binding.
 * @exception NamingException if a naming exception is encountered
 */
@Override
protected NamingEnumeration<Binding> doListBindings(String strName)
  throws NamingException {
  
  Name name = getEscapedJndiName(strName);
  if (name.isEmpty())
    return new NamingContextBindingsEnumeration(list(entries).iterator(),
        this);
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
  
  return new NamingContextBindingsEnumeration(list(entry).iterator(),
      this);
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Enumerates the names bound in the named context, along with the 
 * objects bound to them. The contents of any subcontexts are not 
 * included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param strName the name of the context to list
 * @return an enumeration of the bindings in this context. 
 * Each element of the enumeration is of type Binding.
 * @exception NamingException if a naming exception is encountered
 */
@Override
protected List<NamingEntry> doListBindings(String strName)
  throws NamingException {
  
  Name name = getEscapedJndiName(strName);
  if (name.isEmpty())
    return list(entries);
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
  
  return list(entry);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Enumerates the names bound in the named context, along with the 
 * objects bound to them. The contents of any subcontexts are not 
 * included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param strName the name of the context to list
 * @return an enumeration of the bindings in this context. 
 * Each element of the enumeration is of type Binding.
 * @exception NamingException if a naming exception is encountered
 */
@Override
protected List<NamingEntry> doListBindings(String strName)
  throws NamingException {
  
  Name name = getEscapedJndiName(strName);
  if (name.isEmpty())
    return list(entries);
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
  
  return list(entry);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Enumerates the names bound in the named context, along with the class 
 * names of objects bound to them. The contents of any subcontexts are 
 * not included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param name the name of the context to list
 * @return an enumeration of the names and class names of the bindings in 
 * this context. Each element of the enumeration is of type NameClassPair.
 * @exception NamingException if a naming exception is encountered
 */
@Override
public NamingEnumeration<NameClassPair> list(Name name)
  throws NamingException {
  if (name.isEmpty())
    return new NamingContextEnumeration(list(entries).iterator());
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NameNotFoundException
      (sm.getString("resources.notFound", name));
  return new NamingContextEnumeration(list(entry).iterator());
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Enumerates the names bound in the named context, along with the class 
 * names of objects bound to them. The contents of any subcontexts are 
 * not included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param name the name of the context to list
 * @return an enumeration of the names and class names of the bindings in 
 * this context. Each element of the enumeration is of type NameClassPair.
 * @exception NamingException if a naming exception is encountered
 */
@Override
public NamingEnumeration<NameClassPair> list(Name name)
  throws NamingException {
  if (name.isEmpty())
    return new NamingContextEnumeration(list(entries).iterator());
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NameNotFoundException
      (sm.getString("resources.notFound", name));
  return new NamingContextEnumeration(list(entry).iterator());
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Enumerates the names bound in the named context, along with the class 
 * names of objects bound to them. The contents of any subcontexts are 
 * not included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param name the name of the context to list
 * @return an enumeration of the names and class names of the bindings in 
 * this context. Each element of the enumeration is of type NameClassPair.
 * @exception NamingException if a naming exception is encountered
 */
@Override
public NamingEnumeration<NameClassPair> list(Name name)
  throws NamingException {
  if (name.isEmpty())
    return new NamingContextEnumeration(list(entries).iterator());
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NameNotFoundException
      (sm.getString("resources.notFound", name));
  return new NamingContextEnumeration(list(entry).iterator());
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Enumerates the names bound in the named context, along with the class 
 * names of objects bound to them. The contents of any subcontexts are 
 * not included.
 * <p>
 * If a binding is added to or removed from this context, its effect on 
 * an enumeration previously returned is undefined.
 * 
 * @param name the name of the context to list
 * @return an enumeration of the names and class names of the bindings in 
 * this context. Each element of the enumeration is of type NameClassPair.
 * @exception NamingException if a naming exception is encountered
 */
@Override
public NamingEnumeration<NameClassPair> list(Name name)
  throws NamingException {
  if (name.isEmpty())
    return new NamingContextEnumeration(list(entries).iterator());
  Entry entry = treeLookup(name);
  if (entry == null)
    throw new NameNotFoundException
      (sm.getString("resources.notFound", name));
  return new NamingContextEnumeration(list(entry).iterator());
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Retrieves the named object.
 * 
 * @param strName the name of the object to look up
 * @return the object bound to name
 */
@Override
protected Object doLookup(String strName) {
  Name name;
  try {
    name = getEscapedJndiName(strName);
  } catch (InvalidNameException e) {
    log.info(sm.getString("resources.invalidName", strName), e);
    return null;
  }
  if (name.isEmpty())
    return this;
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
    
  ZipEntry zipEntry = entry.getEntry();
  if (zipEntry.isDirectory())
    return new WARDirContext(base, entry);
  else
    return new WARResource(entry.getEntry());
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Retrieves the named object.
 * 
 * @param strName the name of the object to look up
 * @return the object bound to name
 */
@Override
protected Object doLookup(String strName) {
  Name name;
  try {
    name = getEscapedJndiName(strName);
  } catch (InvalidNameException e) {
    log.info(sm.getString("resources.invalidName", strName), e);
    return null;
  }
  if (name.isEmpty())
    return this;
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
    
  ZipEntry zipEntry = entry.getEntry();
  if (zipEntry.isDirectory())
    return new WARDirContext(base, entry);
  else
    return new WARResource(entry.getEntry());
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Retrieves the named object.
 * 
 * @param strName the name of the object to look up
 * @return the object bound to name
 */
@Override
protected Object doLookup(String strName) {
  Name name;
  try {
    name = getEscapedJndiName(strName);
  } catch (InvalidNameException e) {
    log.info(sm.getString("resources.invalidName", strName), e);
    return null;
  }
  if (name.isEmpty())
    return this;
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
    
  ZipEntry zipEntry = entry.getEntry();
  if (zipEntry.isDirectory())
    return new WARDirContext(base, entry);
  else
    return new WARResource(entry.getEntry());
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Retrieves the named object.
 * 
 * @param strName the name of the object to look up
 * @return the object bound to name
 */
@Override
protected Object doLookup(String strName) {
  Name name;
  try {
    name = getEscapedJndiName(strName);
  } catch (InvalidNameException e) {
    log.info(sm.getString("resources.invalidName", strName), e);
    return null;
  }
  if (name.isEmpty())
    return this;
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
    
  ZipEntry zipEntry = entry.getEntry();
  if (zipEntry.isDirectory())
    return new WARDirContext(base, entry);
  else
    return new WARResource(entry.getEntry());
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Retrieves the named object.
 * 
 * @param strName the name of the object to look up
 * @return the object bound to name
 */
@Override
protected Object doLookup(String strName) {
  Name name;
  try {
    name = getEscapedJndiName(strName);
  } catch (InvalidNameException e) {
    log.info(sm.getString("resources.invalidName", strName), e);
    return null;
  }
  if (name.isEmpty())
    return this;
  Entry entry = treeLookup(name);
  if (entry == null)
    return null;
    
  ZipEntry zipEntry = entry.getEntry();
  if (zipEntry.isDirectory())
    return new WARDirContext(base, entry);
  else
    return new WARResource(entry.getEntry());
}

相关文章