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 Applications 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 LIFECYCLE_MODULE = "LifecycleModule"; 50 static public final String J2EE_APPLICATION = "J2eeApplication"; 51 static public final String EJB_MODULE = "EjbModule"; 52 static public final String WEB_MODULE = "WebModule"; 53 static public final String CONNECTOR_MODULE = "ConnectorModule"; 54 static public final String APPCLIENT_MODULE = "AppclientModule"; 55 static public final String MBEAN = "Mbean"; 56 57 public Applications() { 58 this(Common.USE_DEFAULT_VALUES); 59 } 60 61 public Applications(int options) 62 { 63 super(comparators, runtimeVersion); 64 initPropertyTables(7); 66 this.createProperty("lifecycle-module", LIFECYCLE_MODULE, Common.SEQUENCE_OR | 67 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 68 LifecycleModule.class); 69 this.createAttribute(LIFECYCLE_MODULE, "name", "Name", 70 AttrProp.CDATA | AttrProp.REQUIRED, 71 null, null); 72 this.createAttribute(LIFECYCLE_MODULE, "class-name", "ClassName", 73 AttrProp.CDATA | AttrProp.REQUIRED, 74 null, null); 75 this.createAttribute(LIFECYCLE_MODULE, "classpath", "Classpath", 76 AttrProp.CDATA | AttrProp.IMPLIED, 77 null, null); 78 this.createAttribute(LIFECYCLE_MODULE, "load-order", "LoadOrder", 79 AttrProp.CDATA | AttrProp.IMPLIED, 80 null, null); 81 this.createAttribute(LIFECYCLE_MODULE, "is-failure-fatal", "IsFailureFatal", 82 AttrProp.CDATA, 83 null, "false"); 84 this.createAttribute(LIFECYCLE_MODULE, "enabled", "Enabled", 85 AttrProp.CDATA, 86 null, "true"); 87 this.createProperty("j2ee-application", J2EE_APPLICATION, Common.SEQUENCE_OR | 88 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 89 J2eeApplication.class); 90 this.createAttribute(J2EE_APPLICATION, "name", "Name", 91 AttrProp.CDATA | AttrProp.REQUIRED, 92 null, null); 93 this.createAttribute(J2EE_APPLICATION, "location", "Location", 94 AttrProp.CDATA | AttrProp.REQUIRED, 95 null, null); 96 this.createAttribute(J2EE_APPLICATION, "object-type", "ObjectType", 97 AttrProp.CDATA, 98 null, "user"); 99 this.createAttribute(J2EE_APPLICATION, "enabled", "Enabled", 100 AttrProp.CDATA, 101 null, "true"); 102 this.createAttribute(J2EE_APPLICATION, "libraries", "Libraries", 103 AttrProp.CDATA | AttrProp.IMPLIED, 104 null, null); 105 this.createAttribute(J2EE_APPLICATION, "availability-enabled", "AvailabilityEnabled", 106 AttrProp.CDATA, 107 null, "false"); 108 this.createAttribute(J2EE_APPLICATION, "directory-deployed", "DirectoryDeployed", 109 AttrProp.CDATA, 110 null, "false"); 111 this.createAttribute(J2EE_APPLICATION, "java-web-start-enabled", "JavaWebStartEnabled", 112 AttrProp.CDATA, 113 null, "true"); 114 this.createProperty("ejb-module", EJB_MODULE, Common.SEQUENCE_OR | 115 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 116 EjbModule.class); 117 this.createAttribute(EJB_MODULE, "name", "Name", 118 AttrProp.CDATA | AttrProp.REQUIRED, 119 null, null); 120 this.createAttribute(EJB_MODULE, "location", "Location", 121 AttrProp.CDATA | AttrProp.REQUIRED, 122 null, null); 123 this.createAttribute(EJB_MODULE, "object-type", "ObjectType", 124 AttrProp.CDATA, 125 null, "user"); 126 this.createAttribute(EJB_MODULE, "enabled", "Enabled", 127 AttrProp.CDATA, 128 null, "true"); 129 this.createAttribute(EJB_MODULE, "libraries", "Libraries", 130 AttrProp.CDATA | AttrProp.IMPLIED, 131 null, null); 132 this.createAttribute(EJB_MODULE, "availability-enabled", "AvailabilityEnabled", 133 AttrProp.CDATA, 134 null, "false"); 135 this.createAttribute(EJB_MODULE, "directory-deployed", "DirectoryDeployed", 136 AttrProp.CDATA, 137 null, "false"); 138 this.createProperty("web-module", WEB_MODULE, Common.SEQUENCE_OR | 139 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 140 WebModule.class); 141 this.createAttribute(WEB_MODULE, "name", "Name", 142 AttrProp.CDATA | AttrProp.REQUIRED, 143 null, null); 144 this.createAttribute(WEB_MODULE, "context-root", "ContextRoot", 145 AttrProp.CDATA | AttrProp.REQUIRED, 146 null, null); 147 this.createAttribute(WEB_MODULE, "location", "Location", 148 AttrProp.CDATA | AttrProp.REQUIRED, 149 null, null); 150 this.createAttribute(WEB_MODULE, "object-type", "ObjectType", 151 AttrProp.CDATA, 152 null, "user"); 153 this.createAttribute(WEB_MODULE, "enabled", "Enabled", 154 AttrProp.CDATA, 155 null, "true"); 156 this.createAttribute(WEB_MODULE, "libraries", "Libraries", 157 AttrProp.CDATA | AttrProp.IMPLIED, 158 null, null); 159 this.createAttribute(WEB_MODULE, "availability-enabled", "AvailabilityEnabled", 160 AttrProp.CDATA, 161 null, "false"); 162 this.createAttribute(WEB_MODULE, "directory-deployed", "DirectoryDeployed", 163 AttrProp.CDATA, 164 null, "false"); 165 this.createProperty("connector-module", CONNECTOR_MODULE, Common.SEQUENCE_OR | 166 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 167 ConnectorModule.class); 168 this.createAttribute(CONNECTOR_MODULE, "name", "Name", 169 AttrProp.CDATA | AttrProp.REQUIRED, 170 null, null); 171 this.createAttribute(CONNECTOR_MODULE, "location", "Location", 172 AttrProp.CDATA | AttrProp.REQUIRED, 173 null, null); 174 this.createAttribute(CONNECTOR_MODULE, "object-type", "ObjectType", 175 AttrProp.CDATA, 176 null, "user"); 177 this.createAttribute(CONNECTOR_MODULE, "enabled", "Enabled", 178 AttrProp.CDATA, 179 null, "true"); 180 this.createAttribute(CONNECTOR_MODULE, "directory-deployed", "DirectoryDeployed", 181 AttrProp.CDATA, 182 null, "false"); 183 this.createProperty("appclient-module", APPCLIENT_MODULE, Common.SEQUENCE_OR | 184 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 185 AppclientModule.class); 186 this.createAttribute(APPCLIENT_MODULE, "name", "Name", 187 AttrProp.CDATA | AttrProp.REQUIRED, 188 null, null); 189 this.createAttribute(APPCLIENT_MODULE, "location", "Location", 190 AttrProp.CDATA | AttrProp.REQUIRED, 191 null, null); 192 this.createAttribute(APPCLIENT_MODULE, "directory-deployed", "DirectoryDeployed", 193 AttrProp.CDATA, 194 null, "false"); 195 this.createAttribute(APPCLIENT_MODULE, "java-web-start-enabled", "JavaWebStartEnabled", 196 AttrProp.CDATA, 197 null, "true"); 198 this.createProperty("mbean", MBEAN, Common.SEQUENCE_OR | 199 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 200 Mbean.class); 201 this.createAttribute(MBEAN, "name", "Name", 202 AttrProp.CDATA | AttrProp.REQUIRED, 203 null, null); 204 this.createAttribute(MBEAN, "object-type", "ObjectType", 205 AttrProp.CDATA, 206 null, "user"); 207 this.createAttribute(MBEAN, "impl-class-name", "ImplClassName", 208 AttrProp.CDATA | AttrProp.REQUIRED, 209 null, null); 210 this.createAttribute(MBEAN, "object-name", "ObjectName", 211 AttrProp.CDATA | AttrProp.IMPLIED, 212 null, null); 213 this.createAttribute(MBEAN, "enabled", "Enabled", 214 AttrProp.CDATA, 215 null, "true"); 216 this.initialize(options); 217 } 218 219 void initialize(int options) { 221 222 } 223 224 public void setLifecycleModule(int index, LifecycleModule value) { 226 this.setValue(LIFECYCLE_MODULE, index, value); 227 } 228 229 public LifecycleModule getLifecycleModule(int index) { 231 return (LifecycleModule)this.getValue(LIFECYCLE_MODULE, index); 232 } 233 234 public void setLifecycleModule(LifecycleModule[] value) { 236 this.setValue(LIFECYCLE_MODULE, value); 237 } 238 239 public LifecycleModule[] getLifecycleModule() { 241 return (LifecycleModule[])this.getValues(LIFECYCLE_MODULE); 242 } 243 244 public int sizeLifecycleModule() { 246 return this.size(LIFECYCLE_MODULE); 247 } 248 249 public int addLifecycleModule(LifecycleModule value) 251 throws ConfigException{ 252 return addLifecycleModule(value, true); 253 } 254 255 public int addLifecycleModule(LifecycleModule value, boolean overwrite) 257 throws ConfigException{ 258 LifecycleModule old = getLifecycleModuleByName(value.getName()); 259 if(old != null) { 260 throw new ConfigException(StringManager.getManager(Applications.class).getString("cannotAddDuplicate", "LifecycleModule")); 261 } 262 return this.addValue(LIFECYCLE_MODULE, value, overwrite); 263 } 264 265 public int removeLifecycleModule(LifecycleModule value){ 270 return this.removeValue(LIFECYCLE_MODULE, value); 271 } 272 273 public int removeLifecycleModule(LifecycleModule value, boolean overwrite) 279 throws StaleWriteConfigException{ 280 return this.removeValue(LIFECYCLE_MODULE, value, overwrite); 281 } 282 283 public LifecycleModule getLifecycleModuleByName(String id) { 284 if (null != id) { id = id.trim(); } 285 LifecycleModule[] o = getLifecycleModule(); 286 if (o == null) return null; 287 288 for (int i=0; i < o.length; i++) { 289 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 290 return o[i]; 291 } 292 } 293 294 return null; 295 296 } 297 public void setJ2eeApplication(int index, J2eeApplication value) { 299 this.setValue(J2EE_APPLICATION, index, value); 300 } 301 302 public J2eeApplication getJ2eeApplication(int index) { 304 return (J2eeApplication)this.getValue(J2EE_APPLICATION, index); 305 } 306 307 public void setJ2eeApplication(J2eeApplication[] value) { 309 this.setValue(J2EE_APPLICATION, value); 310 } 311 312 public J2eeApplication[] getJ2eeApplication() { 314 return (J2eeApplication[])this.getValues(J2EE_APPLICATION); 315 } 316 317 public int sizeJ2eeApplication() { 319 return this.size(J2EE_APPLICATION); 320 } 321 322 public int addJ2eeApplication(J2eeApplication value) 324 throws ConfigException{ 325 return addJ2eeApplication(value, true); 326 } 327 328 public int addJ2eeApplication(J2eeApplication value, boolean overwrite) 330 throws ConfigException{ 331 J2eeApplication old = getJ2eeApplicationByName(value.getName()); 332 if(old != null) { 333 throw new ConfigException(StringManager.getManager(Applications.class).getString("cannotAddDuplicate", "J2eeApplication")); 334 } 335 return this.addValue(J2EE_APPLICATION, value, overwrite); 336 } 337 338 public int removeJ2eeApplication(J2eeApplication value){ 343 return this.removeValue(J2EE_APPLICATION, value); 344 } 345 346 public int removeJ2eeApplication(J2eeApplication value, boolean overwrite) 352 throws StaleWriteConfigException{ 353 return this.removeValue(J2EE_APPLICATION, value, overwrite); 354 } 355 356 public J2eeApplication getJ2eeApplicationByName(String id) { 357 if (null != id) { id = id.trim(); } 358 J2eeApplication[] o = getJ2eeApplication(); 359 if (o == null) return null; 360 361 for (int i=0; i < o.length; i++) { 362 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 363 return o[i]; 364 } 365 } 366 367 return null; 368 369 } 370 public void setEjbModule(int index, EjbModule value) { 372 this.setValue(EJB_MODULE, index, value); 373 } 374 375 public EjbModule getEjbModule(int index) { 377 return (EjbModule)this.getValue(EJB_MODULE, index); 378 } 379 380 public void setEjbModule(EjbModule[] value) { 382 this.setValue(EJB_MODULE, value); 383 } 384 385 public EjbModule[] getEjbModule() { 387 return (EjbModule[])this.getValues(EJB_MODULE); 388 } 389 390 public int sizeEjbModule() { 392 return this.size(EJB_MODULE); 393 } 394 395 public int addEjbModule(EjbModule value) 397 throws ConfigException{ 398 return addEjbModule(value, true); 399 } 400 401 public int addEjbModule(EjbModule value, boolean overwrite) 403 throws ConfigException{ 404 EjbModule old = getEjbModuleByName(value.getName()); 405 if(old != null) { 406 throw new ConfigException(StringManager.getManager(Applications.class).getString("cannotAddDuplicate", "EjbModule")); 407 } 408 return this.addValue(EJB_MODULE, value, overwrite); 409 } 410 411 public int removeEjbModule(EjbModule value){ 416 return this.removeValue(EJB_MODULE, value); 417 } 418 419 public int removeEjbModule(EjbModule value, boolean overwrite) 425 throws StaleWriteConfigException{ 426 return this.removeValue(EJB_MODULE, value, overwrite); 427 } 428 429 public EjbModule getEjbModuleByName(String id) { 430 if (null != id) { id = id.trim(); } 431 EjbModule[] o = getEjbModule(); 432 if (o == null) return null; 433 434 for (int i=0; i < o.length; i++) { 435 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 436 return o[i]; 437 } 438 } 439 440 return null; 441 442 } 443 public void setWebModule(int index, WebModule value) { 445 this.setValue(WEB_MODULE, index, value); 446 } 447 448 public WebModule getWebModule(int index) { 450 return (WebModule)this.getValue(WEB_MODULE, index); 451 } 452 453 public void setWebModule(WebModule[] value) { 455 this.setValue(WEB_MODULE, value); 456 } 457 458 public WebModule[] getWebModule() { 460 return (WebModule[])this.getValues(WEB_MODULE); 461 } 462 463 public int sizeWebModule() { 465 return this.size(WEB_MODULE); 466 } 467 468 public int addWebModule(WebModule value) 470 throws ConfigException{ 471 return addWebModule(value, true); 472 } 473 474 public int addWebModule(WebModule value, boolean overwrite) 476 throws ConfigException{ 477 WebModule old = getWebModuleByName(value.getName()); 478 if(old != null) { 479 throw new ConfigException(StringManager.getManager(Applications.class).getString("cannotAddDuplicate", "WebModule")); 480 } 481 return this.addValue(WEB_MODULE, value, overwrite); 482 } 483 484 public int removeWebModule(WebModule value){ 489 return this.removeValue(WEB_MODULE, value); 490 } 491 492 public int removeWebModule(WebModule value, boolean overwrite) 498 throws StaleWriteConfigException{ 499 return this.removeValue(WEB_MODULE, value, overwrite); 500 } 501 502 public WebModule getWebModuleByName(String id) { 503 if (null != id) { id = id.trim(); } 504 WebModule[] o = getWebModule(); 505 if (o == null) return null; 506 507 for (int i=0; i < o.length; i++) { 508 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 509 return o[i]; 510 } 511 } 512 513 return null; 514 515 } 516 public void setConnectorModule(int index, ConnectorModule value) { 518 this.setValue(CONNECTOR_MODULE, index, value); 519 } 520 521 public ConnectorModule getConnectorModule(int index) { 523 return (ConnectorModule)this.getValue(CONNECTOR_MODULE, index); 524 } 525 526 public void setConnectorModule(ConnectorModule[] value) { 528 this.setValue(CONNECTOR_MODULE, value); 529 } 530 531 public ConnectorModule[] getConnectorModule() { 533 return (ConnectorModule[])this.getValues(CONNECTOR_MODULE); 534 } 535 536 public int sizeConnectorModule() { 538 return this.size(CONNECTOR_MODULE); 539 } 540 541 public int addConnectorModule(ConnectorModule value) 543 throws ConfigException{ 544 return addConnectorModule(value, true); 545 } 546 547 public int addConnectorModule(ConnectorModule value, boolean overwrite) 549 throws ConfigException{ 550 ConnectorModule old = getConnectorModuleByName(value.getName()); 551 if(old != null) { 552 throw new ConfigException(StringManager.getManager(Applications.class).getString("cannotAddDuplicate", "ConnectorModule")); 553 } 554 return this.addValue(CONNECTOR_MODULE, value, overwrite); 555 } 556 557 public int removeConnectorModule(ConnectorModule value){ 562 return this.removeValue(CONNECTOR_MODULE, value); 563 } 564 565 public int removeConnectorModule(ConnectorModule value, boolean overwrite) 571 throws StaleWriteConfigException{ 572 return this.removeValue(CONNECTOR_MODULE, value, overwrite); 573 } 574 575 public ConnectorModule getConnectorModuleByName(String id) { 576 if (null != id) { id = id.trim(); } 577 ConnectorModule[] o = getConnectorModule(); 578 if (o == null) return null; 579 580 for (int i=0; i < o.length; i++) { 581 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 582 return o[i]; 583 } 584 } 585 586 return null; 587 588 } 589 public void setAppclientModule(int index, AppclientModule value) { 591 this.setValue(APPCLIENT_MODULE, index, value); 592 } 593 594 public AppclientModule getAppclientModule(int index) { 596 return (AppclientModule)this.getValue(APPCLIENT_MODULE, index); 597 } 598 599 public void setAppclientModule(AppclientModule[] value) { 601 this.setValue(APPCLIENT_MODULE, value); 602 } 603 604 public AppclientModule[] getAppclientModule() { 606 return (AppclientModule[])this.getValues(APPCLIENT_MODULE); 607 } 608 609 public int sizeAppclientModule() { 611 return this.size(APPCLIENT_MODULE); 612 } 613 614 public int addAppclientModule(AppclientModule value) 616 throws ConfigException{ 617 return addAppclientModule(value, true); 618 } 619 620 public int addAppclientModule(AppclientModule value, boolean overwrite) 622 throws ConfigException{ 623 AppclientModule old = getAppclientModuleByName(value.getName()); 624 if(old != null) { 625 throw new ConfigException(StringManager.getManager(Applications.class).getString("cannotAddDuplicate", "AppclientModule")); 626 } 627 return this.addValue(APPCLIENT_MODULE, value, overwrite); 628 } 629 630 public int removeAppclientModule(AppclientModule value){ 635 return this.removeValue(APPCLIENT_MODULE, value); 636 } 637 638 public int removeAppclientModule(AppclientModule value, boolean overwrite) 644 throws StaleWriteConfigException{ 645 return this.removeValue(APPCLIENT_MODULE, value, overwrite); 646 } 647 648 public AppclientModule getAppclientModuleByName(String id) { 649 if (null != id) { id = id.trim(); } 650 AppclientModule[] o = getAppclientModule(); 651 if (o == null) return null; 652 653 for (int i=0; i < o.length; i++) { 654 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 655 return o[i]; 656 } 657 } 658 659 return null; 660 661 } 662 public void setMbean(int index, Mbean value) { 664 this.setValue(MBEAN, index, value); 665 } 666 667 public Mbean getMbean(int index) { 669 return (Mbean)this.getValue(MBEAN, index); 670 } 671 672 public void setMbean(Mbean[] value) { 674 this.setValue(MBEAN, value); 675 } 676 677 public Mbean[] getMbean() { 679 return (Mbean[])this.getValues(MBEAN); 680 } 681 682 public int sizeMbean() { 684 return this.size(MBEAN); 685 } 686 687 public int addMbean(Mbean value) 689 throws ConfigException{ 690 return addMbean(value, true); 691 } 692 693 public int addMbean(Mbean value, boolean overwrite) 695 throws ConfigException{ 696 Mbean old = getMbeanByName(value.getName()); 697 if(old != null) { 698 throw new ConfigException(StringManager.getManager(Applications.class).getString("cannotAddDuplicate", "Mbean")); 699 } 700 return this.addValue(MBEAN, value, overwrite); 701 } 702 703 public int removeMbean(Mbean value){ 708 return this.removeValue(MBEAN, value); 709 } 710 711 public int removeMbean(Mbean value, boolean overwrite) 717 throws StaleWriteConfigException{ 718 return this.removeValue(MBEAN, value, overwrite); 719 } 720 721 public Mbean getMbeanByName(String id) { 722 if (null != id) { id = id.trim(); } 723 Mbean[] o = getMbean(); 724 if (o == null) return null; 725 726 for (int i=0; i < o.length; i++) { 727 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 728 return o[i]; 729 } 730 } 731 732 return null; 733 734 } 735 739 public LifecycleModule newLifecycleModule() { 740 return new LifecycleModule(); 741 } 742 743 747 public J2eeApplication newJ2eeApplication() { 748 return new J2eeApplication(); 749 } 750 751 755 public EjbModule newEjbModule() { 756 return new EjbModule(); 757 } 758 759 763 public WebModule newWebModule() { 764 return new WebModule(); 765 } 766 767 771 public ConnectorModule newConnectorModule() { 772 return new ConnectorModule(); 773 } 774 775 779 public AppclientModule newAppclientModule() { 780 return new AppclientModule(); 781 } 782 783 787 public Mbean newMbean() { 788 return new Mbean(); 789 } 790 791 796 protected String getRelativeXPath() { 797 String ret = null; 798 ret = "applications"; 799 return (null != ret ? ret.trim() : null); 800 } 801 802 805 public static String getDefaultAttributeValue(String attr) { 806 if(attr == null) return null; 807 attr = attr.trim(); 808 return null; 809 } 810 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 812 comparators.add(c); 813 } 814 815 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 817 comparators.remove(c); 818 } 819 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 820 } 821 822 public void dump(StringBuffer str, String indent){ 824 String s; 825 Object o; 826 org.netbeans.modules.schema2beans.BaseBean n; 827 str.append(indent); 828 str.append("LifecycleModule["+this.sizeLifecycleModule()+"]"); for(int i=0; i<this.sizeLifecycleModule(); i++) 830 { 831 str.append(indent+"\t"); 832 str.append("#"+i+":"); 833 n = (org.netbeans.modules.schema2beans.BaseBean) this.getLifecycleModule(i); 834 if (n != null) 835 n.dump(str, indent + "\t"); else 837 str.append(indent+"\tnull"); this.dumpAttributes(LIFECYCLE_MODULE, i, str, indent); 839 } 840 841 str.append(indent); 842 str.append("J2eeApplication["+this.sizeJ2eeApplication()+"]"); for(int i=0; i<this.sizeJ2eeApplication(); i++) 844 { 845 str.append(indent+"\t"); 846 str.append("#"+i+":"); 847 n = (org.netbeans.modules.schema2beans.BaseBean) this.getJ2eeApplication(i); 848 if (n != null) 849 n.dump(str, indent + "\t"); else 851 str.append(indent+"\tnull"); this.dumpAttributes(J2EE_APPLICATION, i, str, indent); 853 } 854 855 str.append(indent); 856 str.append("EjbModule["+this.sizeEjbModule()+"]"); for(int i=0; i<this.sizeEjbModule(); i++) 858 { 859 str.append(indent+"\t"); 860 str.append("#"+i+":"); 861 n = (org.netbeans.modules.schema2beans.BaseBean) this.getEjbModule(i); 862 if (n != null) 863 n.dump(str, indent + "\t"); else 865 str.append(indent+"\tnull"); this.dumpAttributes(EJB_MODULE, i, str, indent); 867 } 868 869 str.append(indent); 870 str.append("WebModule["+this.sizeWebModule()+"]"); for(int i=0; i<this.sizeWebModule(); i++) 872 { 873 str.append(indent+"\t"); 874 str.append("#"+i+":"); 875 n = (org.netbeans.modules.schema2beans.BaseBean) this.getWebModule(i); 876 if (n != null) 877 n.dump(str, indent + "\t"); else 879 str.append(indent+"\tnull"); this.dumpAttributes(WEB_MODULE, i, str, indent); 881 } 882 883 str.append(indent); 884 str.append("ConnectorModule["+this.sizeConnectorModule()+"]"); for(int i=0; i<this.sizeConnectorModule(); i++) 886 { 887 str.append(indent+"\t"); 888 str.append("#"+i+":"); 889 n = (org.netbeans.modules.schema2beans.BaseBean) this.getConnectorModule(i); 890 if (n != null) 891 n.dump(str, indent + "\t"); else 893 str.append(indent+"\tnull"); this.dumpAttributes(CONNECTOR_MODULE, i, str, indent); 895 } 896 897 str.append(indent); 898 str.append("AppclientModule["+this.sizeAppclientModule()+"]"); for(int i=0; i<this.sizeAppclientModule(); i++) 900 { 901 str.append(indent+"\t"); 902 str.append("#"+i+":"); 903 n = (org.netbeans.modules.schema2beans.BaseBean) this.getAppclientModule(i); 904 if (n != null) 905 n.dump(str, indent + "\t"); else 907 str.append(indent+"\tnull"); this.dumpAttributes(APPCLIENT_MODULE, i, str, indent); 909 } 910 911 str.append(indent); 912 str.append("Mbean["+this.sizeMbean()+"]"); for(int i=0; i<this.sizeMbean(); i++) 914 { 915 str.append(indent+"\t"); 916 str.append("#"+i+":"); 917 n = (org.netbeans.modules.schema2beans.BaseBean) this.getMbean(i); 918 if (n != null) 919 n.dump(str, indent + "\t"); else 921 str.append(indent+"\tnull"); this.dumpAttributes(MBEAN, i, str, indent); 923 } 924 925 } 926 public String dumpBeanNode(){ 927 StringBuffer str = new StringBuffer (); 928 str.append("Applications\n"); this.dump(str, "\n "); return str.toString(); 931 }} 932 933 935 | Popular Tags |