1 7 8 package org.openejb.alt.config.ejb11; 9 10 14 import java.io.IOException ; 15 import java.io.Reader ; 16 import java.io.Serializable ; 17 import java.io.Writer ; 18 import java.util.Enumeration ; 19 import java.util.Vector ; 20 import org.exolab.castor.xml.MarshalException; 21 import org.exolab.castor.xml.Marshaller; 22 import org.exolab.castor.xml.Unmarshaller; 23 import org.exolab.castor.xml.ValidationException; 24 import org.xml.sax.ContentHandler ; 25 26 31 public class Session implements java.io.Serializable { 32 33 34 38 41 private java.lang.String _id; 42 43 46 private java.lang.String _description; 47 48 51 private java.lang.String _displayName; 52 53 56 private java.lang.String _smallIcon; 57 58 61 private java.lang.String _largeIcon; 62 63 66 private java.lang.String _ejbName; 67 68 71 private java.lang.String _home; 72 73 76 private java.lang.String _remote; 77 78 81 private java.lang.String _localHome; 82 83 86 private java.lang.String _local; 87 88 91 private java.lang.String _ejbClass; 92 93 96 private java.lang.String _sessionType; 97 98 101 private java.lang.String _transactionType; 102 103 106 private java.util.Vector _envEntryList; 107 108 111 private java.util.Vector _ejbRefList; 112 113 116 private java.util.Vector _ejbLocalRefList; 117 118 121 private java.util.Vector _securityRoleRefList; 122 123 126 private java.util.Vector _resourceRefList; 127 128 129 133 public Session() { 134 super(); 135 _envEntryList = new Vector (); 136 _ejbRefList = new Vector (); 137 _ejbLocalRefList = new Vector (); 138 _securityRoleRefList = new Vector (); 139 _resourceRefList = new Vector (); 140 } 142 143 147 154 public void addEjbLocalRef(org.openejb.alt.config.ejb11.EjbLocalRef vEjbLocalRef) 155 throws java.lang.IndexOutOfBoundsException 156 { 157 _ejbLocalRefList.addElement(vEjbLocalRef); 158 } 160 168 public void addEjbLocalRef(int index, org.openejb.alt.config.ejb11.EjbLocalRef vEjbLocalRef) 169 throws java.lang.IndexOutOfBoundsException 170 { 171 _ejbLocalRefList.insertElementAt(vEjbLocalRef, index); 172 } 174 179 public void addEjbRef(org.openejb.alt.config.ejb11.EjbRef vEjbRef) 180 throws java.lang.IndexOutOfBoundsException 181 { 182 _ejbRefList.addElement(vEjbRef); 183 } 185 191 public void addEjbRef(int index, org.openejb.alt.config.ejb11.EjbRef vEjbRef) 192 throws java.lang.IndexOutOfBoundsException 193 { 194 _ejbRefList.insertElementAt(vEjbRef, index); 195 } 197 202 public void addEnvEntry(org.openejb.alt.config.ejb11.EnvEntry vEnvEntry) 203 throws java.lang.IndexOutOfBoundsException 204 { 205 _envEntryList.addElement(vEnvEntry); 206 } 208 214 public void addEnvEntry(int index, org.openejb.alt.config.ejb11.EnvEntry vEnvEntry) 215 throws java.lang.IndexOutOfBoundsException 216 { 217 _envEntryList.insertElementAt(vEnvEntry, index); 218 } 220 225 public void addResourceRef(org.openejb.alt.config.ejb11.ResourceRef vResourceRef) 226 throws java.lang.IndexOutOfBoundsException 227 { 228 _resourceRefList.addElement(vResourceRef); 229 } 231 237 public void addResourceRef(int index, org.openejb.alt.config.ejb11.ResourceRef vResourceRef) 238 throws java.lang.IndexOutOfBoundsException 239 { 240 _resourceRefList.insertElementAt(vResourceRef, index); 241 } 243 248 public void addSecurityRoleRef(org.openejb.alt.config.ejb11.SecurityRoleRef vSecurityRoleRef) 249 throws java.lang.IndexOutOfBoundsException 250 { 251 _securityRoleRefList.addElement(vSecurityRoleRef); 252 } 254 260 public void addSecurityRoleRef(int index, org.openejb.alt.config.ejb11.SecurityRoleRef vSecurityRoleRef) 261 throws java.lang.IndexOutOfBoundsException 262 { 263 _securityRoleRefList.insertElementAt(vSecurityRoleRef, index); 264 } 266 273 public java.util.Enumeration enumerateEjbLocalRef() 274 { 275 return _ejbLocalRefList.elements(); 276 } 278 281 public java.util.Enumeration enumerateEjbRef() 282 { 283 return _ejbRefList.elements(); 284 } 286 289 public java.util.Enumeration enumerateEnvEntry() 290 { 291 return _envEntryList.elements(); 292 } 294 297 public java.util.Enumeration enumerateResourceRef() 298 { 299 return _resourceRefList.elements(); 300 } 302 305 public java.util.Enumeration enumerateSecurityRoleRef() 306 { 307 return _securityRoleRefList.elements(); 308 } 310 315 public java.lang.String getDescription() 316 { 317 return this._description; 318 } 320 325 public java.lang.String getDisplayName() 326 { 327 return this._displayName; 328 } 330 335 public java.lang.String getEjbClass() 336 { 337 return this._ejbClass; 338 } 340 348 public org.openejb.alt.config.ejb11.EjbLocalRef getEjbLocalRef(int index) 349 throws java.lang.IndexOutOfBoundsException 350 { 351 if ((index < 0) || (index > _ejbLocalRefList.size())) { 353 throw new IndexOutOfBoundsException (); 354 } 355 356 return (org.openejb.alt.config.ejb11.EjbLocalRef) _ejbLocalRefList.elementAt(index); 357 } 359 366 public org.openejb.alt.config.ejb11.EjbLocalRef[] getEjbLocalRef() 367 { 368 int size = _ejbLocalRefList.size(); 369 org.openejb.alt.config.ejb11.EjbLocalRef[] mArray = new org.openejb.alt.config.ejb11.EjbLocalRef[size]; 370 for (int index = 0; index < size; index++) { 371 mArray[index] = (org.openejb.alt.config.ejb11.EjbLocalRef) _ejbLocalRefList.elementAt(index); 372 } 373 return mArray; 374 } 376 383 public int getEjbLocalRefCount() 384 { 385 return _ejbLocalRefList.size(); 386 } 388 393 public java.lang.String getEjbName() 394 { 395 return this._ejbName; 396 } 398 403 public org.openejb.alt.config.ejb11.EjbRef getEjbRef(int index) 404 throws java.lang.IndexOutOfBoundsException 405 { 406 if ((index < 0) || (index > _ejbRefList.size())) { 408 throw new IndexOutOfBoundsException (); 409 } 410 411 return (org.openejb.alt.config.ejb11.EjbRef) _ejbRefList.elementAt(index); 412 } 414 417 public org.openejb.alt.config.ejb11.EjbRef[] getEjbRef() 418 { 419 int size = _ejbRefList.size(); 420 org.openejb.alt.config.ejb11.EjbRef[] mArray = new org.openejb.alt.config.ejb11.EjbRef[size]; 421 for (int index = 0; index < size; index++) { 422 mArray[index] = (org.openejb.alt.config.ejb11.EjbRef) _ejbRefList.elementAt(index); 423 } 424 return mArray; 425 } 427 430 public int getEjbRefCount() 431 { 432 return _ejbRefList.size(); 433 } 435 440 public org.openejb.alt.config.ejb11.EnvEntry getEnvEntry(int index) 441 throws java.lang.IndexOutOfBoundsException 442 { 443 if ((index < 0) || (index > _envEntryList.size())) { 445 throw new IndexOutOfBoundsException (); 446 } 447 448 return (org.openejb.alt.config.ejb11.EnvEntry) _envEntryList.elementAt(index); 449 } 451 454 public org.openejb.alt.config.ejb11.EnvEntry[] getEnvEntry() 455 { 456 int size = _envEntryList.size(); 457 org.openejb.alt.config.ejb11.EnvEntry[] mArray = new org.openejb.alt.config.ejb11.EnvEntry[size]; 458 for (int index = 0; index < size; index++) { 459 mArray[index] = (org.openejb.alt.config.ejb11.EnvEntry) _envEntryList.elementAt(index); 460 } 461 return mArray; 462 } 464 467 public int getEnvEntryCount() 468 { 469 return _envEntryList.size(); 470 } 472 477 public java.lang.String getHome() 478 { 479 return this._home; 480 } 482 487 public java.lang.String getId() 488 { 489 return this._id; 490 } 492 497 public java.lang.String getLargeIcon() 498 { 499 return this._largeIcon; 500 } 502 508 public java.lang.String getLocal() 509 { 510 return this._local; 511 } 513 519 public java.lang.String getLocalHome() 520 { 521 return this._localHome; 522 } 524 529 public java.lang.String getRemote() 530 { 531 return this._remote; 532 } 534 539 public org.openejb.alt.config.ejb11.ResourceRef getResourceRef(int index) 540 throws java.lang.IndexOutOfBoundsException 541 { 542 if ((index < 0) || (index > _resourceRefList.size())) { 544 throw new IndexOutOfBoundsException (); 545 } 546 547 return (org.openejb.alt.config.ejb11.ResourceRef) _resourceRefList.elementAt(index); 548 } 550 553 public org.openejb.alt.config.ejb11.ResourceRef[] getResourceRef() 554 { 555 int size = _resourceRefList.size(); 556 org.openejb.alt.config.ejb11.ResourceRef[] mArray = new org.openejb.alt.config.ejb11.ResourceRef[size]; 557 for (int index = 0; index < size; index++) { 558 mArray[index] = (org.openejb.alt.config.ejb11.ResourceRef) _resourceRefList.elementAt(index); 559 } 560 return mArray; 561 } 563 566 public int getResourceRefCount() 567 { 568 return _resourceRefList.size(); 569 } 571 576 public org.openejb.alt.config.ejb11.SecurityRoleRef getSecurityRoleRef(int index) 577 throws java.lang.IndexOutOfBoundsException 578 { 579 if ((index < 0) || (index > _securityRoleRefList.size())) { 581 throw new IndexOutOfBoundsException (); 582 } 583 584 return (org.openejb.alt.config.ejb11.SecurityRoleRef) _securityRoleRefList.elementAt(index); 585 } 587 590 public org.openejb.alt.config.ejb11.SecurityRoleRef[] getSecurityRoleRef() 591 { 592 int size = _securityRoleRefList.size(); 593 org.openejb.alt.config.ejb11.SecurityRoleRef[] mArray = new org.openejb.alt.config.ejb11.SecurityRoleRef[size]; 594 for (int index = 0; index < size; index++) { 595 mArray[index] = (org.openejb.alt.config.ejb11.SecurityRoleRef) _securityRoleRefList.elementAt(index); 596 } 597 return mArray; 598 } 600 603 public int getSecurityRoleRefCount() 604 { 605 return _securityRoleRefList.size(); 606 } 608 613 public java.lang.String getSessionType() 614 { 615 return this._sessionType; 616 } 618 623 public java.lang.String getSmallIcon() 624 { 625 return this._smallIcon; 626 } 628 633 public java.lang.String getTransactionType() 634 { 635 return this._transactionType; 636 } 638 641 public boolean isValid() 642 { 643 try { 644 validate(); 645 } 646 catch (org.exolab.castor.xml.ValidationException vex) { 647 return false; 648 } 649 return true; 650 } 652 657 public void marshal(java.io.Writer out) 658 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 659 { 660 661 Marshaller.marshal(this, out); 662 } 664 669 public void marshal(org.xml.sax.ContentHandler handler) 670 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 671 { 672 673 Marshaller.marshal(this, handler); 674 } 676 680 public void removeAllEjbLocalRef() 681 { 682 _ejbLocalRefList.removeAllElements(); 683 } 685 688 public void removeAllEjbRef() 689 { 690 _ejbRefList.removeAllElements(); 691 } 693 696 public void removeAllEnvEntry() 697 { 698 _envEntryList.removeAllElements(); 699 } 701 704 public void removeAllResourceRef() 705 { 706 _resourceRefList.removeAllElements(); 707 } 709 712 public void removeAllSecurityRoleRef() 713 { 714 _securityRoleRefList.removeAllElements(); 715 } 717 725 public org.openejb.alt.config.ejb11.EjbLocalRef removeEjbLocalRef(int index) 726 { 727 java.lang.Object obj = _ejbLocalRefList.elementAt(index); 728 _ejbLocalRefList.removeElementAt(index); 729 return (org.openejb.alt.config.ejb11.EjbLocalRef) obj; 730 } 732 737 public org.openejb.alt.config.ejb11.EjbRef removeEjbRef(int index) 738 { 739 java.lang.Object obj = _ejbRefList.elementAt(index); 740 _ejbRefList.removeElementAt(index); 741 return (org.openejb.alt.config.ejb11.EjbRef) obj; 742 } 744 749 public org.openejb.alt.config.ejb11.EnvEntry removeEnvEntry(int index) 750 { 751 java.lang.Object obj = _envEntryList.elementAt(index); 752 _envEntryList.removeElementAt(index); 753 return (org.openejb.alt.config.ejb11.EnvEntry) obj; 754 } 756 761 public org.openejb.alt.config.ejb11.ResourceRef removeResourceRef(int index) 762 { 763 java.lang.Object obj = _resourceRefList.elementAt(index); 764 _resourceRefList.removeElementAt(index); 765 return (org.openejb.alt.config.ejb11.ResourceRef) obj; 766 } 768 773 public org.openejb.alt.config.ejb11.SecurityRoleRef removeSecurityRoleRef(int index) 774 { 775 java.lang.Object obj = _securityRoleRefList.elementAt(index); 776 _securityRoleRefList.removeElementAt(index); 777 return (org.openejb.alt.config.ejb11.SecurityRoleRef) obj; 778 } 780 785 public void setDescription(java.lang.String description) 786 { 787 this._description = description; 788 } 790 795 public void setDisplayName(java.lang.String displayName) 796 { 797 this._displayName = displayName; 798 } 800 805 public void setEjbClass(java.lang.String ejbClass) 806 { 807 this._ejbClass = ejbClass; 808 } 810 818 public void setEjbLocalRef(int index, org.openejb.alt.config.ejb11.EjbLocalRef vEjbLocalRef) 819 throws java.lang.IndexOutOfBoundsException 820 { 821 if ((index < 0) || (index > _ejbLocalRefList.size())) { 823 throw new IndexOutOfBoundsException (); 824 } 825 _ejbLocalRefList.setElementAt(vEjbLocalRef, index); 826 } 828 835 public void setEjbLocalRef(org.openejb.alt.config.ejb11.EjbLocalRef[] ejbLocalRefArray) 836 { 837 _ejbLocalRefList.removeAllElements(); 839 for (int i = 0; i < ejbLocalRefArray.length; i++) { 840 _ejbLocalRefList.addElement(ejbLocalRefArray[i]); 841 } 842 } 844 849 public void setEjbName(java.lang.String ejbName) 850 { 851 this._ejbName = ejbName; 852 } 854 860 public void setEjbRef(int index, org.openejb.alt.config.ejb11.EjbRef vEjbRef) 861 throws java.lang.IndexOutOfBoundsException 862 { 863 if ((index < 0) || (index > _ejbRefList.size())) { 865 throw new IndexOutOfBoundsException (); 866 } 867 _ejbRefList.setElementAt(vEjbRef, index); 868 } 870 875 public void setEjbRef(org.openejb.alt.config.ejb11.EjbRef[] ejbRefArray) 876 { 877 _ejbRefList.removeAllElements(); 879 for (int i = 0; i < ejbRefArray.length; i++) { 880 _ejbRefList.addElement(ejbRefArray[i]); 881 } 882 } 884 890 public void setEnvEntry(int index, org.openejb.alt.config.ejb11.EnvEntry vEnvEntry) 891 throws java.lang.IndexOutOfBoundsException 892 { 893 if ((index < 0) || (index > _envEntryList.size())) { 895 throw new IndexOutOfBoundsException (); 896 } 897 _envEntryList.setElementAt(vEnvEntry, index); 898 } 900 905 public void setEnvEntry(org.openejb.alt.config.ejb11.EnvEntry[] envEntryArray) 906 { 907 _envEntryList.removeAllElements(); 909 for (int i = 0; i < envEntryArray.length; i++) { 910 _envEntryList.addElement(envEntryArray[i]); 911 } 912 } 914 919 public void setHome(java.lang.String home) 920 { 921 this._home = home; 922 } 924 929 public void setId(java.lang.String id) 930 { 931 this._id = id; 932 } 934 939 public void setLargeIcon(java.lang.String largeIcon) 940 { 941 this._largeIcon = largeIcon; 942 } 944 949 public void setLocal(java.lang.String local) 950 { 951 this._local = local; 952 } 954 959 public void setLocalHome(java.lang.String localHome) 960 { 961 this._localHome = localHome; 962 } 964 969 public void setRemote(java.lang.String remote) 970 { 971 this._remote = remote; 972 } 974 980 public void setResourceRef(int index, org.openejb.alt.config.ejb11.ResourceRef vResourceRef) 981 throws java.lang.IndexOutOfBoundsException 982 { 983 if ((index < 0) || (index > _resourceRefList.size())) { 985 throw new IndexOutOfBoundsException (); 986 } 987 _resourceRefList.setElementAt(vResourceRef, index); 988 } 990 995 public void setResourceRef(org.openejb.alt.config.ejb11.ResourceRef[] resourceRefArray) 996 { 997 _resourceRefList.removeAllElements(); 999 for (int i = 0; i < resourceRefArray.length; i++) { 1000 _resourceRefList.addElement(resourceRefArray[i]); 1001 } 1002 } 1004 1010 public void setSecurityRoleRef(int index, org.openejb.alt.config.ejb11.SecurityRoleRef vSecurityRoleRef) 1011 throws java.lang.IndexOutOfBoundsException 1012 { 1013 if ((index < 0) || (index > _securityRoleRefList.size())) { 1015 throw new IndexOutOfBoundsException (); 1016 } 1017 _securityRoleRefList.setElementAt(vSecurityRoleRef, index); 1018 } 1020 1025 public void setSecurityRoleRef(org.openejb.alt.config.ejb11.SecurityRoleRef[] securityRoleRefArray) 1026 { 1027 _securityRoleRefList.removeAllElements(); 1029 for (int i = 0; i < securityRoleRefArray.length; i++) { 1030 _securityRoleRefList.addElement(securityRoleRefArray[i]); 1031 } 1032 } 1034 1039 public void setSessionType(java.lang.String sessionType) 1040 { 1041 this._sessionType = sessionType; 1042 } 1044 1049 public void setSmallIcon(java.lang.String smallIcon) 1050 { 1051 this._smallIcon = smallIcon; 1052 } 1054 1059 public void setTransactionType(java.lang.String transactionType) 1060 { 1061 this._transactionType = transactionType; 1062 } 1064 1069 public static java.lang.Object unmarshal(java.io.Reader reader) 1070 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 1071 { 1072 return (org.openejb.alt.config.ejb11.Session) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.Session.class, reader); 1073 } 1075 1078 public void validate() 1079 throws org.exolab.castor.xml.ValidationException 1080 { 1081 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 1082 validator.validate(this); 1083 } 1085} 1086 | Popular Tags |