1 22 package org.jboss.services.deployment; 23 24 import java.io.Serializable ; 25 import java.util.Properties ; 26 27 35 public class MBeanData implements Serializable 36 { 37 38 private static final long serialVersionUID = -4870385245742489112L; 39 40 43 private String name; 44 45 50 private String xpath; 51 52 56 private String templateName; 57 58 64 private Properties depends; 65 66 70 private Properties attributes; 71 72 75 public final Properties getAttributes() 76 { 77 return attributes; 78 } 79 80 83 public final void setAttributes(Properties attributes) 84 { 85 this.attributes = attributes; 86 } 87 88 91 public final Properties getDepends() 92 { 93 return depends; 94 } 95 96 99 public final void setDepends(Properties depends) 100 { 101 this.depends = depends; 102 } 103 104 107 public final String getName() 108 { 109 return name; 110 } 111 112 115 public final void setName(String name) 116 { 117 this.name = name; 118 } 119 120 125 public String getTemplateName() 126 { 127 return templateName; 128 } 129 130 135 public void setTemplateName(String templateName) 136 { 137 this.templateName = templateName; 138 } 139 140 143 public final String getXpath() 144 { 145 if (xpath == null) 146 { 147 asXpath(); 148 } 149 return xpath; 150 } 151 152 155 public String toString() 156 { 157 return name; 158 } 159 160 209 private void asXpath() 210 { 211 212 if (name.indexOf(',') == -1) 214 { 215 xpath = "@name='" + name + "'"; 216 } 217 else 218 { 219 String [] parts = name.split("[,:]"); 221 StringBuffer buf = new StringBuffer (2 * name.length()); 222 buf.append("starts-with(@name, '"); 223 buf.append(parts[0]); 224 for (int i = 1; i < parts.length; i++) 225 { 226 buf.append("') and contains(@name, '"); 227 buf.append(parts[i]); 228 } 229 buf.append("') and string-length(@name) = "); 230 buf.append(name.length()); 231 xpath = buf.toString(); 232 } 233 } 234 } 235 | Popular Tags |