1 23 24 31 32 package com.sun.enterprise.admin.server.core.mbean.config.naming; 33 34 import com.sun.enterprise.admin.common.ObjectNames; 35 import com.sun.enterprise.config.serverbeans.ServerXPathHelper; 36 39 public class MBeansDescriptions 40 { 41 final static String CONFIG_MBEANS_BASE_CLASS_PREFIX = "com.sun.enterprise.admin.server.core.mbean.config."; 42 final static String DOMAIN_PROLOG = "ias:"; 43 final static char PATTERNS_SEPARATOR = '|'; 44 45 final static int MODE_CONFIG = 0x0001; 46 final static int MODE_MONITOR = 0x0002; 47 48 final static Object [][] mbean_descriptions = 50 { 51 { 53 ObjectNames.kServerInstance, 54 MODE(MODE_CONFIG), 55 "{0}", ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kServerInstance, 57 ObjectNames.kNameKeyName, "{0}"), 58 XPATH_TO_MASK(ServerXPathHelper.getServerIdXpath("{0}")), "ManagedServerInstance", }, 61 { 63 ObjectNames.kHTTPServiceType, 64 MODE(MODE_CONFIG | MODE_MONITOR), 65 "{0}.http-service", ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kHTTPServiceType, 67 ObjectNames.kServerInstanceKeyName, "{0}"), 68 XPATH_TO_MASK(ServerXPathHelper.getHTTPServiceXpath()), "ManagedHTTPService", }, 71 { 73 ObjectNames.kHTTPListenerType, 74 MODE(MODE_CONFIG), 75 "{0}.http-listener.{1} | {0}.http-service.http-listener.{1}", ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kHTTPListenerType, 77 ObjectNames.kServerInstanceKeyName, "{0}", 78 ObjectNames.kNameKeyName, "{1}"), 79 XPATH_TO_MASK(ServerXPathHelper.getHTTPListenerIdXpath("{1}")), "ManagedHTTPListener", }, 82 { 84 ObjectNames.kOrbType, 85 MODE(MODE_CONFIG), 86 "{0}.orb | {0}.iiop-service" , 87 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kOrbType, 88 ObjectNames.kServerInstanceKeyName, "{0}"), 89 XPATH_TO_MASK(ServerXPathHelper.getIIOPServiceXpath()), "ManagedORBComponent", }, 92 { 94 ObjectNames.kOrbListenerType, 95 MODE(MODE_CONFIG), 96 "{0}.orblistener.{1} | {0}.iiop-listener.{1}" , 97 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kOrbListenerType, 98 ObjectNames.kServerInstanceKeyName, "{0}", 99 ObjectNames.kNameKeyName, "{1}"), 100 XPATH_TO_MASK(ServerXPathHelper.getIIOPListenerIdXpath("{1}")), "ManagedORBListener", }, 103 { 104 ObjectNames.kJdbcResourceType, 105 MODE(MODE_CONFIG), 106 "{0}.jdbc-resource.{1}" , 107 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kJdbcResourceType, 108 ObjectNames.kServerInstanceKeyName, "{0}", 109 ObjectNames.kNameKeyName, "{1}" ), 110 XPATH_TO_MASK(ServerXPathHelper.getJDBCResourceIdXpath("{1}")), "ManagedJDBCResource", }, 113 { 114 ObjectNames.kJdbcConnectionPoolType, 115 MODE(MODE_CONFIG), 116 "{0}.jdbc-connection-pool.{1}" , 117 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kJdbcConnectionPoolType, 118 ObjectNames.kServerInstanceKeyName, "{0}", 119 ObjectNames.kNameKeyName, "{1}" ), 120 XPATH_TO_MASK(ServerXPathHelper.getJDBCConnectionPoolIdXpath("{1}")), "ManagedJDBCConnectionPool", }, 123 { 124 ObjectNames.kJndiResourceType, 125 MODE(MODE_CONFIG), 126 "{0}.external-jndi-resource.{1} | {0}.jndi-resource.{1}" , 127 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kJndiResourceType, 128 ObjectNames.kServerInstanceKeyName, "{0}", 129 ObjectNames.kNameKeyName, "{1}" ), 130 XPATH_TO_MASK(ServerXPathHelper.getJNDIResourceIdXpath("{1}")), "ManagedJNDIResource", }, 133 { 134 ObjectNames.kCustomResourceType, 135 MODE(MODE_CONFIG), 136 "{0}.custom-resource.{1}" , 137 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kCustomResourceType, 138 ObjectNames.kServerInstanceKeyName, "{0}", 139 ObjectNames.kNameKeyName, "{1}" ), 140 XPATH_TO_MASK(ServerXPathHelper.getCustomResourceIdXpath("{1}")), "ManagedCustomResource", }, 143 { 144 ObjectNames.kJtsComponent, 145 MODE(MODE_CONFIG | MODE_MONITOR), 146 "{0}.transaction-service", 147 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kJtsComponent, 148 ObjectNames.kServerInstanceKeyName, "{0}"), 149 XPATH_TO_MASK(ServerXPathHelper.getTransactionServiceXpath()), "ManagedTransactionService", 152 }, 153 { 154 ObjectNames.kMdbContainer, 155 MODE(MODE_CONFIG), 156 "{0}.mdb-container", 157 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kMdbContainer, 158 ObjectNames.kServerInstanceKeyName, "{0}"), 159 XPATH_TO_MASK(ServerXPathHelper.getMDBContainerXpath()), "ManagedMdbContainer", 162 }, 163 { 164 ObjectNames.kEjbContainer, 165 MODE(MODE_CONFIG), 166 "{0}.ejb-container", 167 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kEjbContainer, 168 ObjectNames.kServerInstanceKeyName, "{0}"), 169 XPATH_TO_MASK(ServerXPathHelper.getEJBContainerXpath()), "ManagedEjbContainer", 172 }, 173 { 174 ObjectNames.kWebContainer, 175 MODE(MODE_CONFIG), 176 "{0}.web-container", 177 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kWebContainer, 178 ObjectNames.kServerInstanceKeyName, "{0}"), 179 XPATH_TO_MASK(ServerXPathHelper.getWEBContainerXpath()), "ManagedWebContainer", 182 }, 183 { 184 ObjectNames.kJMSAdminHandler, 185 MODE(MODE_CONFIG), 186 "{0}.jms-service", 187 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kJMSAdminHandler, 188 ObjectNames.kServerInstanceKeyName, "{0}"), 189 XPATH_TO_MASK(ServerXPathHelper.getJmsServiceXpath()), "JMSAdminHandler", 192 }, 193 { 194 ObjectNames.kJvmType, 195 MODE(MODE_CONFIG), 196 "{0}.java-config", 197 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kJvmType, 198 ObjectNames.kServerInstanceKeyName, "{0}"), 199 XPATH_TO_MASK(ServerXPathHelper.getJavaConfigXpath()), "ManagedJVM", }, 202 { 203 ObjectNames.kLogService, 204 MODE(MODE_CONFIG), 205 "{0}.log-service", 206 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kLogService, 207 ObjectNames.kServerInstanceKeyName, "{0}"), 208 XPATH_TO_MASK(ServerXPathHelper.getLogServiceXpath()), "ManagedLogService", 211 }, 212 { 213 ObjectNames.kSecurityServiceType, 214 MODE(MODE_CONFIG), 215 "{0}.security-service" , 216 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kSecurityServiceType, 217 ObjectNames.kServerInstanceKeyName, "{0}"), 218 XPATH_TO_MASK(ServerXPathHelper.getSecurityServiceXpath()), "ManagedSecurityService", }, 221 { 222 ObjectNames.kApplication, 223 MODE(MODE_CONFIG), 224 "{0}.j2ee-application.{1} | {0}.application.{1}" , 225 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kApplication, 226 ObjectNames.kServerInstanceKeyName, "{0}", 227 ObjectNames.kNameKeyName, "{1}" ), 228 XPATH_TO_MASK(ServerXPathHelper.getAppIdXpathExpression("{1}")), "ManagedJ2EEApplication", }, 231 { 232 ObjectNames.kStandaloneEjbModule, 233 MODE(MODE_CONFIG), 234 "{0}.ejb-module.{1}" , 235 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kModule, 236 ObjectNames.kModuleTypeKeyName, ObjectNames.kEjbModule, 237 ObjectNames.kServerInstanceKeyName, "{0}", 238 ObjectNames.kNameKeyName, "{1}" ), 239 XPATH_TO_MASK(ServerXPathHelper.getEjbModuleIdXpathExpression("{1}")), "ManagedStandaloneJ2EEEjbJarModule", }, 242 { 243 ObjectNames.kEjbModule, 244 MODE(MODE_CONFIG), 245 "{0}.j2ee-application.{1}.ejb-module.{2} | {0}.application.{1}.ejb-module.{2}" , 246 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kModule, 247 ObjectNames.kModuleTypeKeyName, ObjectNames.kEjbModule, 248 ObjectNames.kServerInstanceKeyName, "{0}", 249 ObjectNames.kNameKeyName, "{2}", 250 ObjectNames.kApplicationNameKeyName, "{1}"), 251 "", "ManagedJ2EEEjbJarModule", }, 254 { 255 ObjectNames.kStandaloneWebModule, 256 MODE(MODE_CONFIG), 257 "{0}.web-module.{1}" , 258 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kModule, 259 ObjectNames.kModuleTypeKeyName, ObjectNames.kWebModule, 260 ObjectNames.kServerInstanceKeyName, "{0}", 261 ObjectNames.kNameKeyName, "{1}" ), 262 XPATH_TO_MASK(ServerXPathHelper.getWebModuleIdXpathExpression("{1}")), "ManagedStandaloneJ2EEWebModule", }, 265 { 266 ObjectNames.kWebModule, 267 MODE(MODE_CONFIG), 268 "{0}.j2ee-application.{1}.web-module.{2} | {0}.application.{1}.web-module.{2}" , 269 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kModule, 270 ObjectNames.kModuleTypeKeyName, ObjectNames.kWebModule, 271 ObjectNames.kServerInstanceKeyName, "{0}", 272 ObjectNames.kApplicationNameKeyName, "{1}", 273 ObjectNames.kNameKeyName, "{2}" ), 274 "", "ManagedJ2EEWebModule", }, 277 { 278 ObjectNames.kConnectorModule, 279 MODE(MODE_CONFIG), 280 "{0}.connector-module.{1}" , 281 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kModule, 282 ObjectNames.kModuleTypeKeyName, ObjectNames.kConnectorModule, 283 ObjectNames.kServerInstanceKeyName, "{0}", 284 ObjectNames.kNameKeyName, "{1}" ), 285 XPATH_TO_MASK(ServerXPathHelper.getConnectorModuleIdXpathExpression("{1}")), "ManagedStandaloneConnectorModule", }, 288 298 { 299 ObjectNames.kLifecycleModule, 300 MODE(MODE_CONFIG), 301 "{0}.lifecycle-module.{1}" , 302 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kLifecycleModule, 303 ObjectNames.kServerInstanceKeyName, "{0}", 304 ObjectNames.kNameKeyName, "{1}" ), 305 XPATH_TO_MASK(ServerXPathHelper.getLifecycleModuleIdXpath("{1}")), "ManagedLifecycleModule", }, 308 { 309 ObjectNames.kVirtualServerClassType, 310 MODE(MODE_CONFIG), 311 "{0}.virtual-server-class" , 312 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kVirtualServerClassType, 313 ObjectNames.kServerInstanceKeyName, "{0}", 314 ObjectNames.kNameKeyName, ObjectNames.kVirtualServerClassDefaultName ), 315 XPATH_TO_MASK(ServerXPathHelper.getHTTPServiceXpath()), "ManagedVirtualServerClass", }, 318 { 319 ObjectNames.kVirtualServerType, 320 MODE(MODE_CONFIG), 321 "{0}.virtual-server.{1}" , 322 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kVirtualServerType, 323 ObjectNames.kServerInstanceKeyName, "{0}", 324 ObjectNames.kVirtualServerClassIdKeyName, ObjectNames.kVirtualServerClassDefaultName, 325 ObjectNames.kNameKeyName, "{1}" ), 326 XPATH_TO_MASK(ServerXPathHelper.getVirtualServerIdXpath(ObjectNames.kVirtualServerClassDefaultName, "{1}")), "ManagedVirtualServer", }, 329 363 { 364 ObjectNames.kAuthRealmType, 365 MODE(MODE_CONFIG), 366 "{0}.authrealm.{1} | {0}.security-service.authrealm.{1}" , 367 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kAuthRealmType, 368 ObjectNames.kServerInstanceKeyName, "{0}", 369 ObjectNames.kNameKeyName, "{1}" ), 370 XPATH_TO_MASK(ServerXPathHelper.getSecurityAuthRealmIdXpath("{1}")), "ManagedAuthRealm", }, 373 { 374 ObjectNames.kPersistenceManagerFactoryResourceType, 375 MODE(MODE_CONFIG), 376 "{0}.persistence-manager-factory-resource.{1} | {0}.resources.persistence-manager-factory-resource.{1}" , 377 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kPersistenceManagerFactoryResourceType, 378 ObjectNames.kServerInstanceKeyName, "{0}", 379 ObjectNames.kNameKeyName, "{1}" ), 380 XPATH_TO_MASK(ServerXPathHelper.getPMFactoryResourceIdXpath("{1}")), "ManagedPMFactoryResource", }, 383 395 { 396 ObjectNames.kMailResourceType, 397 MODE(MODE_CONFIG), 398 "{0}.mail-resource.{1}" , 399 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kMailResourceType, 400 ObjectNames.kServerInstanceKeyName, "{0}", 401 ObjectNames.kNameKeyName, "{1}" ), 402 XPATH_TO_MASK(ServerXPathHelper.getMailResourceIdXpath("{1}")), "ManagedJavaMailResource", }, 405 { 406 ObjectNames.kProfiler, 407 MODE(MODE_CONFIG), 408 "{0}.profiler" , 409 ObjectNamePairs(ObjectNames.kTypeKeyName, ObjectNames.kProfiler, 410 ObjectNames.kServerInstanceKeyName, "{0}" ), 411 XPATH_TO_MASK(ServerXPathHelper.getProfilerXpath()), "ManagedProfiler", }, 414 } ; 415 416 417 418 419 static String ObjectNamePairs(String name1, String value1, String name2, String value2) 421 { 422 return ObjectNamePairs(new String []{name1, value1, name2, value2}); 423 } 424 static String ObjectNamePairs(String name1, String value1, String name2, String value2, String name3, String value3) 425 { 426 return ObjectNamePairs(new String []{name1, value1, name2, value2, name3, value3}); 427 } 428 static String ObjectNamePairs(String name1, String value1, String name2, String value2, String name3, String value3, String name4, String value4) 429 { 430 return ObjectNamePairs(new String []{name1, value1, name2, value2, name3, value3, name4, value4}); 431 } 432 static String ObjectNamePairs(String name1, String value1, String name2, String value2, String name3, String value3, String name4, String value4, String name5, String value5) 433 { 434 return ObjectNamePairs(new String []{name1, value1, name2, value2, name3, value3, name4, value4, name5, value5}); 435 } 436 static String ObjectNamePairs(String [] pairs) 437 { 438 String str = null; 439 for(int i=0; i<pairs.length-1; i = i+2) 440 if(i==0) 441 str = DOMAIN_PROLOG + pairs[i] + "=" + pairs[i+1]; 442 else 443 str = str + "," + pairs[i] + "=" + pairs[i+1]; 444 return str; 446 } 447 448 private static Integer MODE(int type) 449 { 450 return new Integer (type); 451 } 452 453 private static String XPATH_TO_MASK(String xpath) 454 { 455 char[] chrs = xpath.toCharArray(); 456 char[] newchrs = new char[chrs.length*2]; 457 int j = 0; 458 for(int i=0; i<chrs.length; i++) 459 { 460 newchrs[j++] = chrs[i]; 461 if(chrs[i]=='\'') 462 newchrs[j++] = '\''; 463 } 464 return String.valueOf(newchrs, 0, j); 465 } 466 } 467 | Popular Tags |