usr/src/java/rad/org/opensolaris/os/rad/ADRName.java
changeset 685 767674b0a2fb
parent 604 20d9acfeb7fb
child 686 3ead80dd78ec
equal deleted inserted replaced
684:f7b1d1fbdb8e 685:767674b0a2fb
    18  *
    18  *
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
    21 
    21 
    22 /*
    22 /*
    23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    23  * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
    24  */
    24  */
    25 
    25 
    26 package org.opensolaris.os.rad;
    26 package org.opensolaris.os.rad;
    27 
    27 
    28 import java.util.ArrayList;
    28 import java.util.*;
    29 import java.util.Hashtable;
    29 import java.util.logging.*;
    30 import java.util.List;
    30 import javax.management.*;
    31 import java.util.Map;
       
    32 import java.util.TreeMap;
       
    33 import java.util.logging.Level;
       
    34 import java.util.logging.Logger;
       
    35 import javax.management.MalformedObjectNameException;
       
    36 import javax.management.ObjectName;
       
    37 
    31 
    38 public class ADRName {
    32 public class ADRName {
    39     private String domain_;
    33     private String domain_;
    40     private TreeMap<String, String> kvs_ = new TreeMap<String, String>();
    34     private TreeMap<String, String> kvs_ = new TreeMap<String, String>();
    41 
    35 
   136 	 * Unfortunately, the only ObjectName constructor that chooses
   130 	 * Unfortunately, the only ObjectName constructor that chooses
   137 	 * practice over theory is the one that takes the string form, so
   131 	 * practice over theory is the one that takes the string form, so
   138 	 * below we cons up a String so that ObjectName(String) can then
   132 	 * below we cons up a String so that ObjectName(String) can then
   139 	 * immediately undo our work and parse it.
   133 	 * immediately undo our work and parse it.
   140 	 */
   134 	 */
   141 	StringBuffer sb = new StringBuffer(domain_).append(':');
   135 	StringBuilder sb = new StringBuilder(domain_).append(':');
   142 	boolean first = true;
   136 	boolean first = true;
   143 	for (String key : keys_) {
   137 	for (String key : keys_) {
   144 	    if (first)
   138 	    if (first)
   145 		first = false;
   139 		first = false;
   146 	    else
   140 	    else