1 23 24 28 29 package com.sun.enterprise.config.serverbeans; 30 31 import org.w3c.dom.*; 32 import org.netbeans.modules.schema2beans.*; 33 import java.beans.*; 34 import java.util.*; 35 import java.io.Serializable ; 36 import com.sun.enterprise.config.ConfigBean; 37 import com.sun.enterprise.config.ConfigException; 38 import com.sun.enterprise.config.StaleWriteConfigException; 39 import com.sun.enterprise.util.i18n.StringManager; 40 41 43 public class Config extends ConfigBean implements Serializable 44 { 45 46 static Vector comparators = new Vector(); 47 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 48 49 static public final String HTTP_SERVICE = "HttpService"; 50 static public final String IIOP_SERVICE = "IiopService"; 51 static public final String ADMIN_SERVICE = "AdminService"; 52 static public final String CONNECTOR_SERVICE = "ConnectorService"; 53 static public final String WEB_CONTAINER = "WebContainer"; 54 static public final String EJB_CONTAINER = "EjbContainer"; 55 static public final String MDB_CONTAINER = "MdbContainer"; 56 static public final String JMS_SERVICE = "JmsService"; 57 static public final String LOG_SERVICE = "LogService"; 58 static public final String SECURITY_SERVICE = "SecurityService"; 59 static public final String TRANSACTION_SERVICE = "TransactionService"; 60 static public final String MONITORING_SERVICE = "MonitoringService"; 61 static public final String DIAGNOSTIC_SERVICE = "DiagnosticService"; 62 static public final String JAVA_CONFIG = "JavaConfig"; 63 static public final String AVAILABILITY_SERVICE = "AvailabilityService"; 64 static public final String THREAD_POOLS = "ThreadPools"; 65 static public final String ALERT_SERVICE = "AlertService"; 66 static public final String GROUP_MANAGEMENT_SERVICE = "GroupManagementService"; 67 static public final String MANAGEMENT_RULES = "ManagementRules"; 68 static public final String SYSTEM_PROPERTY = "SystemProperty"; 69 static public final String ELEMENT_PROPERTY = "ElementProperty"; 70 71 public Config() { 72 this(Common.USE_DEFAULT_VALUES); 73 } 74 75 public Config(int options) 76 { 77 super(comparators, runtimeVersion); 78 initPropertyTables(21); 80 this.createProperty("http-service", HTTP_SERVICE, 81 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 82 HttpService.class); 83 this.createProperty("iiop-service", IIOP_SERVICE, 84 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 85 IiopService.class); 86 this.createAttribute(IIOP_SERVICE, "client-authentication-required", "ClientAuthenticationRequired", 87 AttrProp.CDATA, 88 null, "false"); 89 this.createProperty("admin-service", ADMIN_SERVICE, 90 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 91 AdminService.class); 92 this.createAttribute(ADMIN_SERVICE, "type", "Type", 93 AttrProp.CDATA, 94 null, "server"); 95 this.createAttribute(ADMIN_SERVICE, "system-jmx-connector-name", "SystemJmxConnectorName", 96 AttrProp.CDATA | AttrProp.IMPLIED, 97 null, null); 98 this.createProperty("connector-service", CONNECTOR_SERVICE, 99 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 100 ConnectorService.class); 101 this.createAttribute(CONNECTOR_SERVICE, "shutdown-timeout-in-seconds", "ShutdownTimeoutInSeconds", 102 AttrProp.CDATA, 103 null, "30"); 104 this.createProperty("web-container", WEB_CONTAINER, 105 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 106 WebContainer.class); 107 this.createProperty("ejb-container", EJB_CONTAINER, 108 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 109 EjbContainer.class); 110 this.createAttribute(EJB_CONTAINER, "steady-pool-size", "SteadyPoolSize", 111 AttrProp.CDATA, 112 null, "32"); 113 this.createAttribute(EJB_CONTAINER, "pool-resize-quantity", "PoolResizeQuantity", 114 AttrProp.CDATA, 115 null, "16"); 116 this.createAttribute(EJB_CONTAINER, "max-pool-size", "MaxPoolSize", 117 AttrProp.CDATA, 118 null, "64"); 119 this.createAttribute(EJB_CONTAINER, "cache-resize-quantity", "CacheResizeQuantity", 120 AttrProp.CDATA, 121 null, "32"); 122 this.createAttribute(EJB_CONTAINER, "max-cache-size", "MaxCacheSize", 123 AttrProp.CDATA, 124 null, "512"); 125 this.createAttribute(EJB_CONTAINER, "pool-idle-timeout-in-seconds", "PoolIdleTimeoutInSeconds", 126 AttrProp.CDATA, 127 null, "600"); 128 this.createAttribute(EJB_CONTAINER, "cache-idle-timeout-in-seconds", "CacheIdleTimeoutInSeconds", 129 AttrProp.CDATA, 130 null, "600"); 131 this.createAttribute(EJB_CONTAINER, "removal-timeout-in-seconds", "RemovalTimeoutInSeconds", 132 AttrProp.CDATA, 133 null, "5400"); 134 this.createAttribute(EJB_CONTAINER, "victim-selection-policy", "VictimSelectionPolicy", 135 AttrProp.CDATA, 136 null, "nru"); 137 this.createAttribute(EJB_CONTAINER, "commit-option", "CommitOption", 138 AttrProp.CDATA, 139 null, "B"); 140 this.createAttribute(EJB_CONTAINER, "session-store", "SessionStore", 141 AttrProp.CDATA | AttrProp.IMPLIED, 142 null, null); 143 this.createProperty("mdb-container", MDB_CONTAINER, 144 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 145 MdbContainer.class); 146 this.createAttribute(MDB_CONTAINER, "steady-pool-size", "SteadyPoolSize", 147 AttrProp.CDATA, 148 null, "10"); 149 this.createAttribute(MDB_CONTAINER, "pool-resize-quantity", "PoolResizeQuantity", 150 AttrProp.CDATA, 151 null, "2"); 152 this.createAttribute(MDB_CONTAINER, "max-pool-size", "MaxPoolSize", 153 AttrProp.CDATA, 154 null, "60"); 155 this.createAttribute(MDB_CONTAINER, "idle-timeout-in-seconds", "IdleTimeoutInSeconds", 156 AttrProp.CDATA, 157 null, "600"); 158 this.createProperty("jms-service", JMS_SERVICE, 159 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 160 JmsService.class); 161 this.createAttribute(JMS_SERVICE, "init-timeout-in-seconds", "InitTimeoutInSeconds", 162 AttrProp.CDATA, 163 null, "60"); 164 this.createAttribute(JMS_SERVICE, "type", "Type", 165 AttrProp.CDATA | AttrProp.REQUIRED, 166 null, null); 167 this.createAttribute(JMS_SERVICE, "start-args", "StartArgs", 168 AttrProp.CDATA | AttrProp.IMPLIED, 169 null, null); 170 this.createAttribute(JMS_SERVICE, "default-jms-host", "DefaultJmsHost", 171 AttrProp.CDATA | AttrProp.IMPLIED, 172 null, null); 173 this.createAttribute(JMS_SERVICE, "reconnect-interval-in-seconds", "ReconnectIntervalInSeconds", 174 AttrProp.CDATA, 175 null, "5"); 176 this.createAttribute(JMS_SERVICE, "reconnect-attempts", "ReconnectAttempts", 177 AttrProp.CDATA, 178 null, "3"); 179 this.createAttribute(JMS_SERVICE, "reconnect-enabled", "ReconnectEnabled", 180 AttrProp.CDATA, 181 null, "true"); 182 this.createAttribute(JMS_SERVICE, "addresslist-behavior", "AddresslistBehavior", 183 AttrProp.CDATA, 184 null, "random"); 185 this.createAttribute(JMS_SERVICE, "addresslist-iterations", "AddresslistIterations", 186 AttrProp.CDATA, 187 null, "3"); 188 this.createAttribute(JMS_SERVICE, "mq-scheme", "MqScheme", 189 AttrProp.CDATA | AttrProp.IMPLIED, 190 null, null); 191 this.createAttribute(JMS_SERVICE, "mq-service", "MqService", 192 AttrProp.CDATA | AttrProp.IMPLIED, 193 null, null); 194 this.createProperty("log-service", LOG_SERVICE, 195 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 196 LogService.class); 197 this.createAttribute(LOG_SERVICE, "file", "File", 198 AttrProp.CDATA | AttrProp.IMPLIED, 199 null, null); 200 this.createAttribute(LOG_SERVICE, "use-system-logging", "UseSystemLogging", 201 AttrProp.CDATA, 202 null, "false"); 203 this.createAttribute(LOG_SERVICE, "log-handler", "LogHandler", 204 AttrProp.CDATA | AttrProp.IMPLIED, 205 null, null); 206 this.createAttribute(LOG_SERVICE, "log-filter", "LogFilter", 207 AttrProp.CDATA | AttrProp.IMPLIED, 208 null, null); 209 this.createAttribute(LOG_SERVICE, "log-to-console", "LogToConsole", 210 AttrProp.CDATA, 211 null, "false"); 212 this.createAttribute(LOG_SERVICE, "log-rotation-limit-in-bytes", "LogRotationLimitInBytes", 213 AttrProp.CDATA, 214 null, "500000"); 215 this.createAttribute(LOG_SERVICE, "log-rotation-timelimit-in-minutes", "LogRotationTimelimitInMinutes", 216 AttrProp.CDATA, 217 null, "0"); 218 this.createAttribute(LOG_SERVICE, "alarms", "Alarms", 219 AttrProp.CDATA, 220 null, "false"); 221 this.createAttribute(LOG_SERVICE, "retain-error-statistics-for-hours", "RetainErrorStatisticsForHours", 222 AttrProp.CDATA, 223 null, "5"); 224 this.createProperty("security-service", SECURITY_SERVICE, 225 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 226 SecurityService.class); 227 this.createAttribute(SECURITY_SERVICE, "default-realm", "DefaultRealm", 228 AttrProp.CDATA, 229 null, "file"); 230 this.createAttribute(SECURITY_SERVICE, "default-principal", "DefaultPrincipal", 231 AttrProp.CDATA | AttrProp.IMPLIED, 232 null, null); 233 this.createAttribute(SECURITY_SERVICE, "default-principal-password", "DefaultPrincipalPassword", 234 AttrProp.CDATA | AttrProp.IMPLIED, 235 null, null); 236 this.createAttribute(SECURITY_SERVICE, "anonymous-role", "AnonymousRole", 237 AttrProp.CDATA, 238 null, "ANYONE"); 239 this.createAttribute(SECURITY_SERVICE, "audit-enabled", "AuditEnabled", 240 AttrProp.CDATA, 241 null, "false"); 242 this.createAttribute(SECURITY_SERVICE, "jacc", "Jacc", 243 AttrProp.CDATA, 244 null, "default"); 245 this.createAttribute(SECURITY_SERVICE, "audit-modules", "AuditModules", 246 AttrProp.CDATA, 247 null, "default"); 248 this.createAttribute(SECURITY_SERVICE, "activate-default-principal-to-role-mapping", "ActivateDefaultPrincipalToRoleMapping", 249 AttrProp.CDATA, 250 null, "false"); 251 this.createAttribute(SECURITY_SERVICE, "mapped-principal-class", "MappedPrincipalClass", 252 AttrProp.CDATA | AttrProp.IMPLIED, 253 null, null); 254 this.createProperty("transaction-service", TRANSACTION_SERVICE, 255 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 256 TransactionService.class); 257 this.createAttribute(TRANSACTION_SERVICE, "automatic-recovery", "AutomaticRecovery", 258 AttrProp.CDATA, 259 null, "false"); 260 this.createAttribute(TRANSACTION_SERVICE, "timeout-in-seconds", "TimeoutInSeconds", 261 AttrProp.CDATA, 262 null, "0"); 263 this.createAttribute(TRANSACTION_SERVICE, "tx-log-dir", "TxLogDir", 264 AttrProp.CDATA | AttrProp.IMPLIED, 265 null, null); 266 this.createAttribute(TRANSACTION_SERVICE, "heuristic-decision", "HeuristicDecision", 267 AttrProp.CDATA, 268 null, "rollback"); 269 this.createAttribute(TRANSACTION_SERVICE, "retry-timeout-in-seconds", "RetryTimeoutInSeconds", 270 AttrProp.CDATA, 271 null, "600"); 272 this.createAttribute(TRANSACTION_SERVICE, "keypoint-interval", "KeypointInterval", 273 AttrProp.CDATA, 274 null, "2048"); 275 this.createProperty("monitoring-service", MONITORING_SERVICE, 276 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 277 MonitoringService.class); 278 this.createProperty("diagnostic-service", DIAGNOSTIC_SERVICE, 279 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 280 DiagnosticService.class); 281 this.createAttribute(DIAGNOSTIC_SERVICE, "compute-checksum", "ComputeChecksum", 282 AttrProp.CDATA, 283 null, "true"); 284 this.createAttribute(DIAGNOSTIC_SERVICE, "verify-config", "VerifyConfig", 285 AttrProp.CDATA, 286 null, "true"); 287 this.createAttribute(DIAGNOSTIC_SERVICE, "capture-install-log", "CaptureInstallLog", 288 AttrProp.CDATA, 289 null, "true"); 290 this.createAttribute(DIAGNOSTIC_SERVICE, "capture-system-info", "CaptureSystemInfo", 291 AttrProp.CDATA, 292 null, "true"); 293 this.createAttribute(DIAGNOSTIC_SERVICE, "capture-hadb-info", "CaptureHadbInfo", 294 AttrProp.CDATA, 295 null, "true"); 296 this.createAttribute(DIAGNOSTIC_SERVICE, "capture-app-dd", "CaptureAppDd", 297 AttrProp.CDATA, 298 null, "true"); 299 this.createAttribute(DIAGNOSTIC_SERVICE, "min-log-level", "MinLogLevel", 300 AttrProp.CDATA, 301 null, "INFO"); 302 this.createAttribute(DIAGNOSTIC_SERVICE, "max-log-entries", "MaxLogEntries", 303 AttrProp.CDATA, 304 null, "500"); 305 this.createProperty("java-config", JAVA_CONFIG, 306 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 307 JavaConfig.class); 308 this.createAttribute(JAVA_CONFIG, "java-home", "JavaHome", 309 AttrProp.CDATA, 310 null, "${com.sun.aas.javaRoot}"); 311 this.createAttribute(JAVA_CONFIG, "debug-enabled", "DebugEnabled", 312 AttrProp.CDATA, 313 null, "false"); 314 this.createAttribute(JAVA_CONFIG, "debug-options", "DebugOptions", 315 AttrProp.CDATA, 316 null, "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n"); 317 this.createAttribute(JAVA_CONFIG, "rmic-options", "RmicOptions", 318 AttrProp.CDATA, 319 null, "-iiop -poa -alwaysgenerate -keepgenerated -g"); 320 this.createAttribute(JAVA_CONFIG, "javac-options", "JavacOptions", 321 AttrProp.CDATA, 322 null, "-g"); 323 this.createAttribute(JAVA_CONFIG, "classpath-prefix", "ClasspathPrefix", 324 AttrProp.CDATA | AttrProp.IMPLIED, 325 null, null); 326 this.createAttribute(JAVA_CONFIG, "classpath-suffix", "ClasspathSuffix", 327 AttrProp.CDATA | AttrProp.IMPLIED, 328 null, null); 329 this.createAttribute(JAVA_CONFIG, "server-classpath", "ServerClasspath", 330 AttrProp.CDATA | AttrProp.IMPLIED, 331 null, null); 332 this.createAttribute(JAVA_CONFIG, "system-classpath", "SystemClasspath", 333 AttrProp.CDATA | AttrProp.IMPLIED, 334 null, null); 335 this.createAttribute(JAVA_CONFIG, "native-library-path-prefix", "NativeLibraryPathPrefix", 336 AttrProp.CDATA | AttrProp.IMPLIED, 337 null, null); 338 this.createAttribute(JAVA_CONFIG, "native-library-path-suffix", "NativeLibraryPathSuffix", 339 AttrProp.CDATA | AttrProp.IMPLIED, 340 null, null); 341 this.createAttribute(JAVA_CONFIG, "bytecode-preprocessors", "BytecodePreprocessors", 342 AttrProp.CDATA | AttrProp.IMPLIED, 343 null, null); 344 this.createAttribute(JAVA_CONFIG, "env-classpath-ignored", "EnvClasspathIgnored", 345 AttrProp.CDATA, 346 null, "true"); 347 this.createProperty("availability-service", AVAILABILITY_SERVICE, 348 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 349 AvailabilityService.class); 350 this.createAttribute(AVAILABILITY_SERVICE, "availability-enabled", "AvailabilityEnabled", 351 AttrProp.CDATA, 352 null, "true"); 353 this.createAttribute(AVAILABILITY_SERVICE, "ha-agent-hosts", "HaAgentHosts", 354 AttrProp.CDATA | AttrProp.IMPLIED, 355 null, null); 356 this.createAttribute(AVAILABILITY_SERVICE, "ha-agent-port", "HaAgentPort", 357 AttrProp.CDATA | AttrProp.IMPLIED, 358 null, null); 359 this.createAttribute(AVAILABILITY_SERVICE, "ha-agent-password", "HaAgentPassword", 360 AttrProp.CDATA | AttrProp.IMPLIED, 361 null, null); 362 this.createAttribute(AVAILABILITY_SERVICE, "ha-store-name", "HaStoreName", 363 AttrProp.CDATA | AttrProp.IMPLIED, 364 null, null); 365 this.createAttribute(AVAILABILITY_SERVICE, "auto-manage-ha-store", "AutoManageHaStore", 366 AttrProp.CDATA, 367 null, "false"); 368 this.createAttribute(AVAILABILITY_SERVICE, "store-pool-name", "StorePoolName", 369 AttrProp.CDATA | AttrProp.IMPLIED, 370 null, null); 371 this.createAttribute(AVAILABILITY_SERVICE, "ha-store-healthcheck-enabled", "HaStoreHealthcheckEnabled", 372 AttrProp.CDATA, 373 null, "false"); 374 this.createAttribute(AVAILABILITY_SERVICE, "ha-store-healthcheck-interval-in-seconds", "HaStoreHealthcheckIntervalInSeconds", 375 AttrProp.CDATA, 376 null, "5"); 377 this.createProperty("thread-pools", THREAD_POOLS, 378 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 379 ThreadPools.class); 380 this.createProperty("alert-service", ALERT_SERVICE, 381 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 382 AlertService.class); 383 this.createProperty("group-management-service", GROUP_MANAGEMENT_SERVICE, 384 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 385 GroupManagementService.class); 386 this.createAttribute(GROUP_MANAGEMENT_SERVICE, "fd-protocol-max-tries", "FdProtocolMaxTries", 387 AttrProp.CDATA, 388 null, "3"); 389 this.createAttribute(GROUP_MANAGEMENT_SERVICE, "fd-protocol-timeout-in-millis", "FdProtocolTimeoutInMillis", 390 AttrProp.CDATA, 391 null, "2000"); 392 this.createAttribute(GROUP_MANAGEMENT_SERVICE, "merge-protocol-max-interval-in-millis", "MergeProtocolMaxIntervalInMillis", 393 AttrProp.CDATA, 394 null, "10000"); 395 this.createAttribute(GROUP_MANAGEMENT_SERVICE, "merge-protocol-min-interval-in-millis", "MergeProtocolMinIntervalInMillis", 396 AttrProp.CDATA, 397 null, "5000"); 398 this.createAttribute(GROUP_MANAGEMENT_SERVICE, "ping-protocol-timeout-in-millis", "PingProtocolTimeoutInMillis", 399 AttrProp.CDATA, 400 null, "2000"); 401 this.createAttribute(GROUP_MANAGEMENT_SERVICE, "vs-protocol-timeout-in-millis", "VsProtocolTimeoutInMillis", 402 AttrProp.CDATA, 403 null, "1500"); 404 this.createProperty("management-rules", MANAGEMENT_RULES, 405 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 406 ManagementRules.class); 407 this.createAttribute(MANAGEMENT_RULES, "enabled", "Enabled", 408 AttrProp.CDATA, 409 null, "true"); 410 this.createProperty("system-property", SYSTEM_PROPERTY, 411 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 412 SystemProperty.class); 413 this.createAttribute(SYSTEM_PROPERTY, "name", "Name", 414 AttrProp.CDATA | AttrProp.REQUIRED, 415 null, null); 416 this.createAttribute(SYSTEM_PROPERTY, "value", "Value", 417 AttrProp.CDATA | AttrProp.REQUIRED, 418 null, null); 419 this.createProperty("property", ELEMENT_PROPERTY, 420 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 421 ElementProperty.class); 422 this.createAttribute(ELEMENT_PROPERTY, "name", "Name", 423 AttrProp.CDATA | AttrProp.REQUIRED, 424 null, null); 425 this.createAttribute(ELEMENT_PROPERTY, "value", "Value", 426 AttrProp.CDATA | AttrProp.REQUIRED, 427 null, null); 428 this.initialize(options); 429 } 430 431 void initialize(int options) { 433 434 } 435 436 public void setHttpService(HttpService value) { 438 this.setValue(HTTP_SERVICE, value); 439 } 440 441 public HttpService getHttpService() { 443 return (HttpService)this.getValue(HTTP_SERVICE); 444 } 445 446 public void setIiopService(IiopService value) { 448 this.setValue(IIOP_SERVICE, value); 449 } 450 451 public IiopService getIiopService() { 453 return (IiopService)this.getValue(IIOP_SERVICE); 454 } 455 456 public void setAdminService(AdminService value) { 458 this.setValue(ADMIN_SERVICE, value); 459 } 460 461 public AdminService getAdminService() { 463 return (AdminService)this.getValue(ADMIN_SERVICE); 464 } 465 466 public void setConnectorService(ConnectorService value) { 468 this.setValue(CONNECTOR_SERVICE, value); 469 } 470 471 public ConnectorService getConnectorService() { 473 return (ConnectorService)this.getValue(CONNECTOR_SERVICE); 474 } 475 476 public void setWebContainer(WebContainer value) { 478 this.setValue(WEB_CONTAINER, value); 479 } 480 481 public WebContainer getWebContainer() { 483 return (WebContainer)this.getValue(WEB_CONTAINER); 484 } 485 486 public void setEjbContainer(EjbContainer value) { 488 this.setValue(EJB_CONTAINER, value); 489 } 490 491 public EjbContainer getEjbContainer() { 493 return (EjbContainer)this.getValue(EJB_CONTAINER); 494 } 495 496 public void setMdbContainer(MdbContainer value) { 498 this.setValue(MDB_CONTAINER, value); 499 } 500 501 public MdbContainer getMdbContainer() { 503 return (MdbContainer)this.getValue(MDB_CONTAINER); 504 } 505 506 public void setJmsService(JmsService value) { 508 this.setValue(JMS_SERVICE, value); 509 } 510 511 public JmsService getJmsService() { 513 return (JmsService)this.getValue(JMS_SERVICE); 514 } 515 516 public void setLogService(LogService value) { 518 this.setValue(LOG_SERVICE, value); 519 } 520 521 public LogService getLogService() { 523 return (LogService)this.getValue(LOG_SERVICE); 524 } 525 526 public void setSecurityService(SecurityService value) { 528 this.setValue(SECURITY_SERVICE, value); 529 } 530 531 public SecurityService getSecurityService() { 533 return (SecurityService)this.getValue(SECURITY_SERVICE); 534 } 535 536 public void setTransactionService(TransactionService value) { 538 this.setValue(TRANSACTION_SERVICE, value); 539 } 540 541 public TransactionService getTransactionService() { 543 return (TransactionService)this.getValue(TRANSACTION_SERVICE); 544 } 545 546 public void setMonitoringService(MonitoringService value) { 548 this.setValue(MONITORING_SERVICE, value); 549 } 550 551 public MonitoringService getMonitoringService() { 553 return (MonitoringService)this.getValue(MONITORING_SERVICE); 554 } 555 556 public void setDiagnosticService(DiagnosticService value) { 558 this.setValue(DIAGNOSTIC_SERVICE, value); 559 } 560 561 public DiagnosticService getDiagnosticService() { 563 return (DiagnosticService)this.getValue(DIAGNOSTIC_SERVICE); 564 } 565 566 public void setJavaConfig(JavaConfig value) { 568 this.setValue(JAVA_CONFIG, value); 569 } 570 571 public JavaConfig getJavaConfig() { 573 return (JavaConfig)this.getValue(JAVA_CONFIG); 574 } 575 576 public void setAvailabilityService(AvailabilityService value) { 578 this.setValue(AVAILABILITY_SERVICE, value); 579 } 580 581 public AvailabilityService getAvailabilityService() { 583 return (AvailabilityService)this.getValue(AVAILABILITY_SERVICE); 584 } 585 586 public void setThreadPools(ThreadPools value) { 588 this.setValue(THREAD_POOLS, value); 589 } 590 591 public ThreadPools getThreadPools() { 593 return (ThreadPools)this.getValue(THREAD_POOLS); 594 } 595 596 public void setAlertService(AlertService value) { 598 this.setValue(ALERT_SERVICE, value); 599 } 600 601 public AlertService getAlertService() { 603 return (AlertService)this.getValue(ALERT_SERVICE); 604 } 605 606 public void setGroupManagementService(GroupManagementService value) { 608 this.setValue(GROUP_MANAGEMENT_SERVICE, value); 609 } 610 611 public GroupManagementService getGroupManagementService() { 613 return (GroupManagementService)this.getValue(GROUP_MANAGEMENT_SERVICE); 614 } 615 616 public void setManagementRules(ManagementRules value) { 618 this.setValue(MANAGEMENT_RULES, value); 619 } 620 621 public ManagementRules getManagementRules() { 623 return (ManagementRules)this.getValue(MANAGEMENT_RULES); 624 } 625 626 public void setSystemProperty(int index, SystemProperty value) { 628 this.setValue(SYSTEM_PROPERTY, index, value); 629 } 630 631 public SystemProperty getSystemProperty(int index) { 633 return (SystemProperty)this.getValue(SYSTEM_PROPERTY, index); 634 } 635 636 public void setSystemProperty(SystemProperty[] value) { 638 this.setValue(SYSTEM_PROPERTY, value); 639 } 640 641 public SystemProperty[] getSystemProperty() { 643 return (SystemProperty[])this.getValues(SYSTEM_PROPERTY); 644 } 645 646 public int sizeSystemProperty() { 648 return this.size(SYSTEM_PROPERTY); 649 } 650 651 public int addSystemProperty(SystemProperty value) 653 throws ConfigException{ 654 return addSystemProperty(value, true); 655 } 656 657 public int addSystemProperty(SystemProperty value, boolean overwrite) 659 throws ConfigException{ 660 SystemProperty old = getSystemPropertyByName(value.getName()); 661 if(old != null) { 662 throw new ConfigException(StringManager.getManager(Config.class).getString("cannotAddDuplicate", "SystemProperty")); 663 } 664 return this.addValue(SYSTEM_PROPERTY, value, overwrite); 665 } 666 667 public int removeSystemProperty(SystemProperty value){ 672 return this.removeValue(SYSTEM_PROPERTY, value); 673 } 674 675 public int removeSystemProperty(SystemProperty value, boolean overwrite) 681 throws StaleWriteConfigException{ 682 return this.removeValue(SYSTEM_PROPERTY, value, overwrite); 683 } 684 685 public SystemProperty getSystemPropertyByName(String id) { 686 if (null != id) { id = id.trim(); } 687 SystemProperty[] o = getSystemProperty(); 688 if (o == null) return null; 689 690 for (int i=0; i < o.length; i++) { 691 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 692 return o[i]; 693 } 694 } 695 696 return null; 697 698 } 699 public void setElementProperty(int index, ElementProperty value) { 701 this.setValue(ELEMENT_PROPERTY, index, value); 702 } 703 704 public ElementProperty getElementProperty(int index) { 706 return (ElementProperty)this.getValue(ELEMENT_PROPERTY, index); 707 } 708 709 public void setElementProperty(ElementProperty[] value) { 711 this.setValue(ELEMENT_PROPERTY, value); 712 } 713 714 public ElementProperty[] getElementProperty() { 716 return (ElementProperty[])this.getValues(ELEMENT_PROPERTY); 717 } 718 719 public int sizeElementProperty() { 721 return this.size(ELEMENT_PROPERTY); 722 } 723 724 public int addElementProperty(ElementProperty value) 726 throws ConfigException{ 727 return addElementProperty(value, true); 728 } 729 730 public int addElementProperty(ElementProperty value, boolean overwrite) 732 throws ConfigException{ 733 ElementProperty old = getElementPropertyByName(value.getName()); 734 if(old != null) { 735 throw new ConfigException(StringManager.getManager(Config.class).getString("cannotAddDuplicate", "ElementProperty")); 736 } 737 return this.addValue(ELEMENT_PROPERTY, value, overwrite); 738 } 739 740 public int removeElementProperty(ElementProperty value){ 745 return this.removeValue(ELEMENT_PROPERTY, value); 746 } 747 748 public int removeElementProperty(ElementProperty value, boolean overwrite) 754 throws StaleWriteConfigException{ 755 return this.removeValue(ELEMENT_PROPERTY, value, overwrite); 756 } 757 758 public ElementProperty getElementPropertyByName(String id) { 759 if (null != id) { id = id.trim(); } 760 ElementProperty[] o = getElementProperty(); 761 if (o == null) return null; 762 763 for (int i=0; i < o.length; i++) { 764 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 765 return o[i]; 766 } 767 } 768 769 return null; 770 771 } 772 776 public String getName() { 777 return getAttributeValue(ServerTags.NAME); 778 } 779 784 public void setName(String v, boolean overwrite) throws StaleWriteConfigException { 785 setAttributeValue(ServerTags.NAME, v, overwrite); 786 } 787 791 public void setName(String v) { 792 setAttributeValue(ServerTags.NAME, v); 793 } 794 798 public boolean isDynamicReconfigurationEnabled() { 799 return toBoolean(getAttributeValue(ServerTags.DYNAMIC_RECONFIGURATION_ENABLED)); 800 } 801 806 public void setDynamicReconfigurationEnabled(boolean v, boolean overwrite) throws StaleWriteConfigException { 807 setAttributeValue(ServerTags.DYNAMIC_RECONFIGURATION_ENABLED, ""+(v==true), overwrite); 808 } 809 813 public void setDynamicReconfigurationEnabled(boolean v) { 814 setAttributeValue(ServerTags.DYNAMIC_RECONFIGURATION_ENABLED, ""+(v==true)); 815 } 816 819 public static String getDefaultDynamicReconfigurationEnabled() { 820 return "true".trim(); 821 } 822 826 public HttpService newHttpService() { 827 return new HttpService(); 828 } 829 830 834 public IiopService newIiopService() { 835 return new IiopService(); 836 } 837 838 842 public AdminService newAdminService() { 843 return new AdminService(); 844 } 845 846 850 public ConnectorService newConnectorService() { 851 return new ConnectorService(); 852 } 853 854 858 public WebContainer newWebContainer() { 859 return new WebContainer(); 860 } 861 862 866 public EjbContainer newEjbContainer() { 867 return new EjbContainer(); 868 } 869 870 874 public MdbContainer newMdbContainer() { 875 return new MdbContainer(); 876 } 877 878 882 public JmsService newJmsService() { 883 return new JmsService(); 884 } 885 886 890 public LogService newLogService() { 891 return new LogService(); 892 } 893 894 898 public SecurityService newSecurityService() { 899 return new SecurityService(); 900 } 901 902 906 public TransactionService newTransactionService() { 907 return new TransactionService(); 908 } 909 910 914 public MonitoringService newMonitoringService() { 915 return new MonitoringService(); 916 } 917 918 922 public DiagnosticService newDiagnosticService() { 923 return new DiagnosticService(); 924 } 925 926 930 public JavaConfig newJavaConfig() { 931 return new JavaConfig(); 932 } 933 934 938 public AvailabilityService newAvailabilityService() { 939 return new AvailabilityService(); 940 } 941 942 946 public ThreadPools newThreadPools() { 947 return new ThreadPools(); 948 } 949 950 954 public AlertService newAlertService() { 955 return new AlertService(); 956 } 957 958 962 public GroupManagementService newGroupManagementService() { 963 return new GroupManagementService(); 964 } 965 966 970 public ManagementRules newManagementRules() { 971 return new ManagementRules(); 972 } 973 974 978 public SystemProperty newSystemProperty() { 979 return new SystemProperty(); 980 } 981 982 986 public ElementProperty newElementProperty() { 987 return new ElementProperty(); 988 } 989 990 995 protected String getRelativeXPath() { 996 String ret = null; 997 ret = "config" + (canHaveSiblings() ? "[@name='" + getAttributeValue("name") +"']" : "") ; 998 return (null != ret ? ret.trim() : null); 999 } 1000 1001 1004 public static String getDefaultAttributeValue(String attr) { 1005 if(attr == null) return null; 1006 attr = attr.trim(); 1007 if(attr.equals(ServerTags.DYNAMIC_RECONFIGURATION_ENABLED)) return "true".trim(); 1008 return null; 1009 } 1010 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 1012 comparators.add(c); 1013 } 1014 1015 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 1017 comparators.remove(c); 1018 } 1019 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 1020 } 1021 1022 public void dump(StringBuffer str, String indent){ 1024 String s; 1025 Object o; 1026 org.netbeans.modules.schema2beans.BaseBean n; 1027 str.append(indent); 1028 str.append("HttpService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getHttpService(); 1030 if (n != null) 1031 n.dump(str, indent + "\t"); else 1033 str.append(indent+"\tnull"); this.dumpAttributes(HTTP_SERVICE, 0, str, indent); 1035 1036 str.append(indent); 1037 str.append("IiopService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getIiopService(); 1039 if (n != null) 1040 n.dump(str, indent + "\t"); else 1042 str.append(indent+"\tnull"); this.dumpAttributes(IIOP_SERVICE, 0, str, indent); 1044 1045 str.append(indent); 1046 str.append("AdminService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getAdminService(); 1048 if (n != null) 1049 n.dump(str, indent + "\t"); else 1051 str.append(indent+"\tnull"); this.dumpAttributes(ADMIN_SERVICE, 0, str, indent); 1053 1054 str.append(indent); 1055 str.append("ConnectorService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getConnectorService(); 1057 if (n != null) 1058 n.dump(str, indent + "\t"); else 1060 str.append(indent+"\tnull"); this.dumpAttributes(CONNECTOR_SERVICE, 0, str, indent); 1062 1063 str.append(indent); 1064 str.append("WebContainer"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getWebContainer(); 1066 if (n != null) 1067 n.dump(str, indent + "\t"); else 1069 str.append(indent+"\tnull"); this.dumpAttributes(WEB_CONTAINER, 0, str, indent); 1071 1072 str.append(indent); 1073 str.append("EjbContainer"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getEjbContainer(); 1075 if (n != null) 1076 n.dump(str, indent + "\t"); else 1078 str.append(indent+"\tnull"); this.dumpAttributes(EJB_CONTAINER, 0, str, indent); 1080 1081 str.append(indent); 1082 str.append("MdbContainer"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getMdbContainer(); 1084 if (n != null) 1085 n.dump(str, indent + "\t"); else 1087 str.append(indent+"\tnull"); this.dumpAttributes(MDB_CONTAINER, 0, str, indent); 1089 1090 str.append(indent); 1091 str.append("JmsService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getJmsService(); 1093 if (n != null) 1094 n.dump(str, indent + "\t"); else 1096 str.append(indent+"\tnull"); this.dumpAttributes(JMS_SERVICE, 0, str, indent); 1098 1099 str.append(indent); 1100 str.append("LogService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getLogService(); 1102 if (n != null) 1103 n.dump(str, indent + "\t"); else 1105 str.append(indent+"\tnull"); this.dumpAttributes(LOG_SERVICE, 0, str, indent); 1107 1108 str.append(indent); 1109 str.append("SecurityService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getSecurityService(); 1111 if (n != null) 1112 n.dump(str, indent + "\t"); else 1114 str.append(indent+"\tnull"); this.dumpAttributes(SECURITY_SERVICE, 0, str, indent); 1116 1117 str.append(indent); 1118 str.append("TransactionService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getTransactionService(); 1120 if (n != null) 1121 n.dump(str, indent + "\t"); else 1123 str.append(indent+"\tnull"); this.dumpAttributes(TRANSACTION_SERVICE, 0, str, indent); 1125 1126 str.append(indent); 1127 str.append("MonitoringService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getMonitoringService(); 1129 if (n != null) 1130 n.dump(str, indent + "\t"); else 1132 str.append(indent+"\tnull"); this.dumpAttributes(MONITORING_SERVICE, 0, str, indent); 1134 1135 str.append(indent); 1136 str.append("DiagnosticService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getDiagnosticService(); 1138 if (n != null) 1139 n.dump(str, indent + "\t"); else 1141 str.append(indent+"\tnull"); this.dumpAttributes(DIAGNOSTIC_SERVICE, 0, str, indent); 1143 1144 str.append(indent); 1145 str.append("JavaConfig"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getJavaConfig(); 1147 if (n != null) 1148 n.dump(str, indent + "\t"); else 1150 str.append(indent+"\tnull"); this.dumpAttributes(JAVA_CONFIG, 0, str, indent); 1152 1153 str.append(indent); 1154 str.append("AvailabilityService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getAvailabilityService(); 1156 if (n != null) 1157 n.dump(str, indent + "\t"); else 1159 str.append(indent+"\tnull"); this.dumpAttributes(AVAILABILITY_SERVICE, 0, str, indent); 1161 1162 str.append(indent); 1163 str.append("ThreadPools"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getThreadPools(); 1165 if (n != null) 1166 n.dump(str, indent + "\t"); else 1168 str.append(indent+"\tnull"); this.dumpAttributes(THREAD_POOLS, 0, str, indent); 1170 1171 str.append(indent); 1172 str.append("AlertService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getAlertService(); 1174 if (n != null) 1175 n.dump(str, indent + "\t"); else 1177 str.append(indent+"\tnull"); this.dumpAttributes(ALERT_SERVICE, 0, str, indent); 1179 1180 str.append(indent); 1181 str.append("GroupManagementService"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getGroupManagementService(); 1183 if (n != null) 1184 n.dump(str, indent + "\t"); else 1186 str.append(indent+"\tnull"); this.dumpAttributes(GROUP_MANAGEMENT_SERVICE, 0, str, indent); 1188 1189 str.append(indent); 1190 str.append("ManagementRules"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getManagementRules(); 1192 if (n != null) 1193 n.dump(str, indent + "\t"); else 1195 str.append(indent+"\tnull"); this.dumpAttributes(MANAGEMENT_RULES, 0, str, indent); 1197 1198 str.append(indent); 1199 str.append("SystemProperty["+this.sizeSystemProperty()+"]"); for(int i=0; i<this.sizeSystemProperty(); i++) 1201 { 1202 str.append(indent+"\t"); 1203 str.append("#"+i+":"); 1204 n = (org.netbeans.modules.schema2beans.BaseBean) this.getSystemProperty(i); 1205 if (n != null) 1206 n.dump(str, indent + "\t"); else 1208 str.append(indent+"\tnull"); this.dumpAttributes(SYSTEM_PROPERTY, i, str, indent); 1210 } 1211 1212 str.append(indent); 1213 str.append("ElementProperty["+this.sizeElementProperty()+"]"); for(int i=0; i<this.sizeElementProperty(); i++) 1215 { 1216 str.append(indent+"\t"); 1217 str.append("#"+i+":"); 1218 n = (org.netbeans.modules.schema2beans.BaseBean) this.getElementProperty(i); 1219 if (n != null) 1220 n.dump(str, indent + "\t"); else 1222 str.append(indent+"\tnull"); this.dumpAttributes(ELEMENT_PROPERTY, i, str, indent); 1224 } 1225 1226 } 1227 public String dumpBeanNode(){ 1228 StringBuffer str = new StringBuffer (); 1229 str.append("Config\n"); this.dump(str, "\n "); return str.toString(); 1232 }} 1233 1234 1236 | Popular Tags |