Java Code Examples for javax.naming.Name#clone()

The following examples show how to use javax.naming.Name#clone() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResolveResult.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
      * Adds components to the end of remaining name.
      *
      * @param name The components to add. Can be null.
      * @see #getRemainingName
      * @see #setRemainingName
      * @see #appendRemainingComponent
      */
    public void appendRemainingName(Name name) {
//      System.out.println("appendingRemainingName: " + name.toString());
//      Exception e = new Exception();
//      e.printStackTrace();
        if (name != null) {
            if (this.remainingName != null) {
                try {
                    this.remainingName.addAll(name);
                } catch (InvalidNameException e) {
                    // ignore; shouldn't happen for composite name
                }
            } else {
                this.remainingName = (Name)(name.clone());
            }
        }
    }
 
Example 2
Source File: ResolveResult.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
      * Adds components to the end of remaining name.
      *
      * @param name The components to add. Can be null.
      * @see #getRemainingName
      * @see #setRemainingName
      * @see #appendRemainingComponent
      */
    public void appendRemainingName(Name name) {
//      System.out.println("appendingRemainingName: " + name.toString());
//      Exception e = new Exception();
//      e.printStackTrace();
        if (name != null) {
            if (this.remainingName != null) {
                try {
                    this.remainingName.addAll(name);
                } catch (InvalidNameException e) {
                    // ignore; shouldn't happen for composite name
                }
            } else {
                this.remainingName = (Name)(name.clone());
            }
        }
    }
 
Example 3
Source File: ResolveResult.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
      * Adds components to the end of remaining name.
      *
      * @param name The components to add. Can be null.
      * @see #getRemainingName
      * @see #setRemainingName
      * @see #appendRemainingComponent
      */
    public void appendRemainingName(Name name) {
//      System.out.println("appendingRemainingName: " + name.toString());
//      Exception e = new Exception();
//      e.printStackTrace();
        if (name != null) {
            if (this.remainingName != null) {
                try {
                    this.remainingName.addAll(name);
                } catch (InvalidNameException e) {
                    // ignore; shouldn't happen for composite name
                }
            } else {
                this.remainingName = (Name)(name.clone());
            }
        }
    }
 
Example 4
Source File: ResolveResult.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
      * Adds components to the end of remaining name.
      *
      * @param name The components to add. Can be null.
      * @see #getRemainingName
      * @see #setRemainingName
      * @see #appendRemainingComponent
      */
    public void appendRemainingName(Name name) {
//      System.out.println("appendingRemainingName: " + name.toString());
//      Exception e = new Exception();
//      e.printStackTrace();
        if (name != null) {
            if (this.remainingName != null) {
                try {
                    this.remainingName.addAll(name);
                } catch (InvalidNameException e) {
                    // ignore; shouldn't happen for composite name
                }
            } else {
                this.remainingName = (Name)(name.clone());
            }
        }
    }
 
Example 5
Source File: ResolveResult.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
      * Adds components to the end of remaining name.
      *
      * @param name The components to add. Can be null.
      * @see #getRemainingName
      * @see #setRemainingName
      * @see #appendRemainingComponent
      */
    public void appendRemainingName(Name name) {
//      System.out.println("appendingRemainingName: " + name.toString());
//      Exception e = new Exception();
//      e.printStackTrace();
        if (name != null) {
            if (this.remainingName != null) {
                try {
                    this.remainingName.addAll(name);
                } catch (InvalidNameException e) {
                    // ignore; shouldn't happen for composite name
                }
            } else {
                this.remainingName = (Name)(name.clone());
            }
        }
    }
 
Example 6
Source File: ResolveResult.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
      * Adds components to the end of remaining name.
      *
      * @param name The components to add. Can be null.
      * @see #getRemainingName
      * @see #setRemainingName
      * @see #appendRemainingComponent
      */
    public void appendRemainingName(Name name) {
//      System.out.println("appendingRemainingName: " + name.toString());
//      Exception e = new Exception();
//      e.printStackTrace();
        if (name != null) {
            if (this.remainingName != null) {
                try {
                    this.remainingName.addAll(name);
                } catch (InvalidNameException e) {
                    // ignore; shouldn't happen for composite name
                }
            } else {
                this.remainingName = (Name)(name.clone());
            }
        }
    }
 
Example 7
Source File: ResolveResult.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
      * Adds components to the end of remaining name.
      *
      * @param name The components to add. Can be null.
      * @see #getRemainingName
      * @see #setRemainingName
      * @see #appendRemainingComponent
      */
    public void appendRemainingName(Name name) {
//      System.out.println("appendingRemainingName: " + name.toString());
//      Exception e = new Exception();
//      e.printStackTrace();
        if (name != null) {
            if (this.remainingName != null) {
                try {
                    this.remainingName.addAll(name);
                } catch (InvalidNameException e) {
                    // ignore; shouldn't happen for composite name
                }
            } else {
                this.remainingName = (Name)(name.clone());
            }
        }
    }
 
Example 8
Source File: right_LmiInitialContext_1.6.java    From gumtree-spoon-ast-diff with Apache License 2.0 5 votes vote down vote up
public Name composeName(Name name, Name prefix) throws NamingException {
    if (TraceCarol.isDebugJndiCarol()) {
        TraceCarol.debugJndiCarol("LmiInitialContext.composeName(" + name + "," + prefix + ")");
    }
    Name result = (Name) (prefix.clone());
    result.addAll(name);
    return result;
}
 
Example 9
Source File: left_LmiInitialContext_1.5.java    From gumtree-spoon-ast-diff with Apache License 2.0 5 votes vote down vote up
public Name composeName(Name name, Name prefix) throws NamingException {
    if (TraceCarol.isDebugJndiCarol()) {
        TraceCarol.debugJndiCarol("LmiInitialContext.composeName(" + name + "," + prefix + ")");
    }
    Name result = (Name) (prefix.clone());
    result.addAll(name);
    return result;
}
 
Example 10
Source File: TestContext.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
@Override
public Name composeName(Name name, Name prefix) throws NamingException {
   Name result = (Name) prefix.clone();
   result.addAll(name);
   return result;
}
 
Example 11
Source File: ReadOnlyContext.java    From qpid-jms with Apache License 2.0 4 votes vote down vote up
@Override
public Name composeName(Name name, Name prefix) throws NamingException {
    Name result = (Name) prefix.clone();
    result.addAll(name);
    return result;
}
 
Example 12
Source File: ResolveResult.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
  * Sets the remaining name field of this result to name.
  * A copy of name is made so that modifying the copy within
  * this ResolveResult does not affect <code>name</code> and
  * vice versa.
  *
  * @param name The name to set remaining name to. Cannot be null.
  * @see #getRemainingName
  * @see #appendRemainingName
  * @see #appendRemainingComponent
  */
public void setRemainingName(Name name) {
    if (name != null)
        this.remainingName = (Name)(name.clone());
    else {
        // ??? should throw illegal argument exception
        this.remainingName = null;
    }
}
 
Example 13
Source File: ResolveResult.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
  * Sets the remaining name field of this result to name.
  * A copy of name is made so that modifying the copy within
  * this ResolveResult does not affect <code>name</code> and
  * vice versa.
  *
  * @param name The name to set remaining name to. Cannot be null.
  * @see #getRemainingName
  * @see #appendRemainingName
  * @see #appendRemainingComponent
  */
public void setRemainingName(Name name) {
    if (name != null)
        this.remainingName = (Name)(name.clone());
    else {
        // ??? should throw illegal argument exception
        this.remainingName = null;
    }
}
 
Example 14
Source File: ResolveResult.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
  * Sets the remaining name field of this result to name.
  * A copy of name is made so that modifying the copy within
  * this ResolveResult does not affect <code>name</code> and
  * vice versa.
  *
  * @param name The name to set remaining name to. Cannot be null.
  * @see #getRemainingName
  * @see #appendRemainingName
  * @see #appendRemainingComponent
  */
public void setRemainingName(Name name) {
    if (name != null)
        this.remainingName = (Name)(name.clone());
    else {
        // ??? should throw illegal argument exception
        this.remainingName = null;
    }
}
 
Example 15
Source File: ProxyDirContext.java    From tomcatsrc with Apache License 2.0 3 votes vote down vote up
/**
 * Composes the name of this context with a name relative to this context.
 * <p>
 * Given a name (name) relative to this context, and the name (prefix) 
 * of this context relative to one of its ancestors, this method returns 
 * the composition of the two names using the syntax appropriate for the 
 * naming system(s) involved. That is, if name names an object relative 
 * to this context, the result is the name of the same object, but 
 * relative to the ancestor context. None of the names may be null.
 * 
 * @param name a name relative to this context
 * @param prefix the name of this context relative to one of its ancestors
 * @return the composition of prefix and name
 * @exception NamingException if a naming exception is encountered
 */
@Override
public Name composeName(Name name, Name prefix)
    throws NamingException {
    Name prefixClone = (Name) prefix.clone();
    return prefixClone.addAll(name);
}
 
Example 16
Source File: ResolveResult.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
  * Sets the remaining name field of this result to name.
  * A copy of name is made so that modifying the copy within
  * this ResolveResult does not affect <code>name</code> and
  * vice versa.
  *
  * @param name The name to set remaining name to. Cannot be null.
  * @see #getRemainingName
  * @see #appendRemainingName
  * @see #appendRemainingComponent
  */
public void setRemainingName(Name name) {
    if (name != null)
        this.remainingName = (Name)(name.clone());
    else {
        // ??? should throw illegal argument exception
        this.remainingName = null;
    }
}
 
Example 17
Source File: ProxyDirContext.java    From Tomcat7.0.67 with Apache License 2.0 3 votes vote down vote up
/**
 * Composes the name of this context with a name relative to this context.
 * <p>
 * Given a name (name) relative to this context, and the name (prefix) 
 * of this context relative to one of its ancestors, this method returns 
 * the composition of the two names using the syntax appropriate for the 
 * naming system(s) involved. That is, if name names an object relative 
 * to this context, the result is the name of the same object, but 
 * relative to the ancestor context. None of the names may be null.
 * 
 * @param name a name relative to this context
 * @param prefix the name of this context relative to one of its ancestors
 * @return the composition of prefix and name
 * @exception NamingException if a naming exception is encountered
 */
@Override
public Name composeName(Name name, Name prefix)
    throws NamingException {
    Name prefixClone = (Name) prefix.clone();
    return prefixClone.addAll(name);
}
 
Example 18
Source File: ResolveResult.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
  * Sets the remaining name field of this result to name.
  * A copy of name is made so that modifying the copy within
  * this ResolveResult does not affect <code>name</code> and
  * vice versa.
  *
  * @param name The name to set remaining name to. Cannot be null.
  * @see #getRemainingName
  * @see #appendRemainingName
  * @see #appendRemainingComponent
  */
public void setRemainingName(Name name) {
    if (name != null)
        this.remainingName = (Name)(name.clone());
    else {
        // ??? should throw illegal argument exception
        this.remainingName = null;
    }
}
 
Example 19
Source File: ResolveResult.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
  * Sets the remaining name field of this result to name.
  * A copy of name is made so that modifying the copy within
  * this ResolveResult does not affect <code>name</code> and
  * vice versa.
  *
  * @param name The name to set remaining name to. Cannot be null.
  * @see #getRemainingName
  * @see #appendRemainingName
  * @see #appendRemainingComponent
  */
public void setRemainingName(Name name) {
    if (name != null)
        this.remainingName = (Name)(name.clone());
    else {
        // ??? should throw illegal argument exception
        this.remainingName = null;
    }
}
 
Example 20
Source File: ResolveResult.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
  * Sets the remaining name field of this result to name.
  * A copy of name is made so that modifying the copy within
  * this ResolveResult does not affect <code>name</code> and
  * vice versa.
  *
  * @param name The name to set remaining name to. Cannot be null.
  * @see #getRemainingName
  * @see #appendRemainingName
  * @see #appendRemainingComponent
  */
public void setRemainingName(Name name) {
    if (name != null)
        this.remainingName = (Name)(name.clone());
    else {
        // ??? should throw illegal argument exception
        this.remainingName = null;
    }
}