Search in sources :

Example 1 with CompoundName

use of javax.naming.CompoundName in project jetty.project by eclipse.

the class NamingContext method composeName.

/*------------------------------------------------*/
/** Join two names together. These are treated as
     * CompoundNames.
     *
     * @param name a <code>Name</code> value
     * @param prefix a <code>Name</code> value
     * @return a <code>Name</code> value
     * @exception NamingException if an error occurs
     */
public String composeName(String name, String prefix) throws NamingException {
    if (name == null)
        throw new NamingException("Name cannot be null");
    if (prefix == null)
        throw new NamingException("Prefix cannot be null");
    Name compoundName = _parser.parse(prefix);
    compoundName.add(name);
    return compoundName.toString();
}
Also used : NamingException(javax.naming.NamingException) CompoundName(javax.naming.CompoundName) Name(javax.naming.Name)

Example 2 with CompoundName

use of javax.naming.CompoundName in project jetty.project by eclipse.

the class NamingContext method composeName.

/*------------------------------------------------*/
/** Join two names together. These are treated as
     * CompoundNames.
     *
     * @param name a <code>Name</code> value
     * @param prefix a <code>Name</code> value
     * @return a <code>Name</code> value
     * @exception NamingException if an error occurs
     */
public Name composeName(Name name, Name prefix) throws NamingException {
    if (name == null)
        throw new NamingException("Name cannot be null");
    if (prefix == null)
        throw new NamingException("Prefix cannot be null");
    Name compoundName = (CompoundName) prefix.clone();
    compoundName.addAll(name);
    return compoundName;
}
Also used : CompoundName(javax.naming.CompoundName) NamingException(javax.naming.NamingException) CompoundName(javax.naming.CompoundName) Name(javax.naming.Name)

Aggregations

CompoundName (javax.naming.CompoundName)2 Name (javax.naming.Name)2 NamingException (javax.naming.NamingException)2