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 ContainerTransaction 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.util.Vector _methodList; 52 53 56 private java.lang.String _transAttribute; 57 58 59 63 public ContainerTransaction() { 64 super(); 65 _methodList = new Vector (); 66 } 68 69 73 78 public void addMethod(org.openejb.alt.config.ejb11.Method vMethod) 79 throws java.lang.IndexOutOfBoundsException 80 { 81 _methodList.addElement(vMethod); 82 } 84 90 public void addMethod(int index, org.openejb.alt.config.ejb11.Method vMethod) 91 throws java.lang.IndexOutOfBoundsException 92 { 93 _methodList.insertElementAt(vMethod, index); 94 } 96 99 public java.util.Enumeration enumerateMethod() 100 { 101 return _methodList.elements(); 102 } 104 109 public java.lang.String getDescription() 110 { 111 return this._description; 112 } 114 119 public java.lang.String getId() 120 { 121 return this._id; 122 } 124 129 public org.openejb.alt.config.ejb11.Method getMethod(int index) 130 throws java.lang.IndexOutOfBoundsException 131 { 132 if ((index < 0) || (index > _methodList.size())) { 134 throw new IndexOutOfBoundsException (); 135 } 136 137 return (org.openejb.alt.config.ejb11.Method) _methodList.elementAt(index); 138 } 140 143 public org.openejb.alt.config.ejb11.Method[] getMethod() 144 { 145 int size = _methodList.size(); 146 org.openejb.alt.config.ejb11.Method[] mArray = new org.openejb.alt.config.ejb11.Method[size]; 147 for (int index = 0; index < size; index++) { 148 mArray[index] = (org.openejb.alt.config.ejb11.Method) _methodList.elementAt(index); 149 } 150 return mArray; 151 } 153 156 public int getMethodCount() 157 { 158 return _methodList.size(); 159 } 161 166 public java.lang.String getTransAttribute() 167 { 168 return this._transAttribute; 169 } 171 174 public boolean isValid() 175 { 176 try { 177 validate(); 178 } 179 catch (org.exolab.castor.xml.ValidationException vex) { 180 return false; 181 } 182 return true; 183 } 185 190 public void marshal(java.io.Writer out) 191 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 192 { 193 194 Marshaller.marshal(this, out); 195 } 197 202 public void marshal(org.xml.sax.ContentHandler handler) 203 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 204 { 205 206 Marshaller.marshal(this, handler); 207 } 209 212 public void removeAllMethod() 213 { 214 _methodList.removeAllElements(); 215 } 217 222 public org.openejb.alt.config.ejb11.Method removeMethod(int index) 223 { 224 java.lang.Object obj = _methodList.elementAt(index); 225 _methodList.removeElementAt(index); 226 return (org.openejb.alt.config.ejb11.Method) obj; 227 } 229 234 public void setDescription(java.lang.String description) 235 { 236 this._description = description; 237 } 239 244 public void setId(java.lang.String id) 245 { 246 this._id = id; 247 } 249 255 public void setMethod(int index, org.openejb.alt.config.ejb11.Method vMethod) 256 throws java.lang.IndexOutOfBoundsException 257 { 258 if ((index < 0) || (index > _methodList.size())) { 260 throw new IndexOutOfBoundsException (); 261 } 262 _methodList.setElementAt(vMethod, index); 263 } 265 270 public void setMethod(org.openejb.alt.config.ejb11.Method[] methodArray) 271 { 272 _methodList.removeAllElements(); 274 for (int i = 0; i < methodArray.length; i++) { 275 _methodList.addElement(methodArray[i]); 276 } 277 } 279 284 public void setTransAttribute(java.lang.String transAttribute) 285 { 286 this._transAttribute = transAttribute; 287 } 289 294 public static java.lang.Object unmarshal(java.io.Reader reader) 295 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 296 { 297 return (org.openejb.alt.config.ejb11.ContainerTransaction) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.ContainerTransaction.class, reader); 298 } 300 303 public void validate() 304 throws org.exolab.castor.xml.ValidationException 305 { 306 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 307 validator.validate(this); 308 } 310 } 311 | Popular Tags |