Example usage for javax.naming CompositeName CompositeName

List of usage examples for javax.naming CompositeName CompositeName

Introduction

In this page you can find the example usage for javax.naming CompositeName CompositeName.

Prototype

public CompositeName(String n) throws InvalidNameException 

Source Link

Document

Constructs a new composite name instance by parsing the string n using the composite name syntax (left-to-right, slash separated).

Usage

From source file:de.micromata.genome.util.runtime.LocalSettingsEnv.java

private Name jndiName(String path) throws InvalidNameException {
    String striped = stripJndiProtocol(path);
    String[] components = StringUtils.split(striped, '/');
    if (striped.startsWith("/") == true) {
        striped = striped.substring(1);//from   w w w.j  a v  a2  s .  c o m
    }
    CompositeName ret = new CompositeName(path);

    return ret;
}

From source file:org.apache.naming.NamingContext.java

/**
 * Retrieves the named object./*from   ww  w. j  a v a  2 s  . c  om*/
 * 
 * @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(String name) throws NamingException {
    return lookup(new CompositeName(name), true);
}

From source file:org.apache.naming.NamingContext.java

/**
 * Binds a name to an object./* w w  w . j a  v  a 2 s.co  m*/
 * 
 * @param name the name to bind; may not be empty
 * @param obj the object to bind; possibly null
 * @exception NameAlreadyBoundException if name is already bound
 * @exception InvalidAttributesException if object did not supply all 
 * mandatory attributes
 * @exception NamingException if a naming exception is encountered
 */
public void bind(String name, Object obj) throws NamingException {
    bind(new CompositeName(name), obj);
}

From source file:org.apache.naming.NamingContext.java

/**
 * Binds a name to an object, overwriting any existing binding.
 * //from  w  ww .  j a va2 s  .c  o m
 * @param name the name to bind; may not be empty
 * @param obj the object to bind; possibly null
 * @exception InvalidAttributesException if object did not supply all 
 * mandatory attributes
 * @exception NamingException if a naming exception is encountered
 */
public void rebind(String name, Object obj) throws NamingException {
    rebind(new CompositeName(name), obj);
}

From source file:org.apache.naming.NamingContext.java

/**
 * Unbinds the named object.// www  . j a v  a  2s. c  om
 * 
 * @param name the name to bind; may not be empty
 * @exception NameNotFoundException if an intermediate context does not 
 * exist
 * @exception NamingException if a naming exception is encountered
 */
public void unbind(String name) throws NamingException {
    unbind(new CompositeName(name));
}

From source file:org.apache.naming.NamingContext.java

/**
 * Binds a new name to the object bound to an old name, and unbinds the 
 * old name.//from w  w  w. ja  v a  2 s  .  c om
 * 
 * @param oldName the name of the existing binding; may not be empty
 * @param newName the name of the new binding; may not be empty
 * @exception NameAlreadyBoundException if newName is already bound
 * @exception NamingException if a naming exception is encountered
 */
public void rename(String oldName, String newName) throws NamingException {
    rename(new CompositeName(oldName), new CompositeName(newName));
}

From source file:org.apache.naming.NamingContext.java

/**
 * Enumerates the names bound in the named context, along with the class 
 * names of objects bound to them.//from w w  w.ja  v  a  2  s .c om
 * 
 * @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(String name) throws NamingException {
    return list(new CompositeName(name));
}

From source file:org.apache.naming.NamingContext.java

/**
 * Enumerates the names bound in the named context, along with the 
 * objects bound to them./*from   ww w.jav a2s.c o  m*/
 * 
 * @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(String name) throws NamingException {
    return listBindings(new CompositeName(name));
}

From source file:org.apache.naming.NamingContext.java

/**
 * Destroys the named context and removes it from the namespace.
 * //w  w w. j  a  v a2 s. com
 * @param name the name of the context to be destroyed; may not be empty
 * @exception NameNotFoundException if an intermediate context does not 
 * exist
 * @exception NotContextException if the name is bound but does not name 
 * a context, or does not name a context of the appropriate type
 */
public void destroySubcontext(String name) throws NamingException {
    destroySubcontext(new CompositeName(name));
}

From source file:org.apache.naming.NamingContext.java

/**
 * Creates and binds a new context.// w  w  w  . ja  va  2s. com
 * 
 * @param name the name of the context to create; may not be empty
 * @return the newly created context
 * @exception NameAlreadyBoundException if name is already bound
 * @exception InvalidAttributesException if creation of the subcontext 
 * requires specification of mandatory attributes
 * @exception NamingException if a naming exception is encountered
 */
public Context createSubcontext(String name) throws NamingException {
    return createSubcontext(new CompositeName(name));
}