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 EjbDeployment implements java.io.Serializable { 32 33 34 38 41 private java.lang.String _ejbName; 42 43 46 private java.lang.String _deploymentId; 47 48 51 private java.lang.String _containerId; 52 53 56 private java.util.Vector _resourceLinkList; 57 58 61 private java.util.Vector _queryList; 62 63 64 68 public EjbDeployment() { 69 super(); 70 _resourceLinkList = new Vector (); 71 _queryList = new Vector (); 72 } 74 75 79 84 public void addQuery(org.openejb.alt.config.ejb11.Query vQuery) 85 throws java.lang.IndexOutOfBoundsException 86 { 87 _queryList.addElement(vQuery); 88 } 90 96 public void addQuery(int index, org.openejb.alt.config.ejb11.Query vQuery) 97 throws java.lang.IndexOutOfBoundsException 98 { 99 _queryList.insertElementAt(vQuery, index); 100 } 102 107 public void addResourceLink(org.openejb.alt.config.ejb11.ResourceLink vResourceLink) 108 throws java.lang.IndexOutOfBoundsException 109 { 110 _resourceLinkList.addElement(vResourceLink); 111 } 113 119 public void addResourceLink(int index, org.openejb.alt.config.ejb11.ResourceLink vResourceLink) 120 throws java.lang.IndexOutOfBoundsException 121 { 122 _resourceLinkList.insertElementAt(vResourceLink, index); 123 } 125 128 public java.util.Enumeration enumerateQuery() 129 { 130 return _queryList.elements(); 131 } 133 136 public java.util.Enumeration enumerateResourceLink() 137 { 138 return _resourceLinkList.elements(); 139 } 141 146 public java.lang.String getContainerId() 147 { 148 return this._containerId; 149 } 151 156 public java.lang.String getDeploymentId() 157 { 158 return this._deploymentId; 159 } 161 166 public java.lang.String getEjbName() 167 { 168 return this._ejbName; 169 } 171 176 public org.openejb.alt.config.ejb11.Query getQuery(int index) 177 throws java.lang.IndexOutOfBoundsException 178 { 179 if ((index < 0) || (index > _queryList.size())) { 181 throw new IndexOutOfBoundsException (); 182 } 183 184 return (org.openejb.alt.config.ejb11.Query) _queryList.elementAt(index); 185 } 187 190 public org.openejb.alt.config.ejb11.Query[] getQuery() 191 { 192 int size = _queryList.size(); 193 org.openejb.alt.config.ejb11.Query[] mArray = new org.openejb.alt.config.ejb11.Query[size]; 194 for (int index = 0; index < size; index++) { 195 mArray[index] = (org.openejb.alt.config.ejb11.Query) _queryList.elementAt(index); 196 } 197 return mArray; 198 } 200 203 public int getQueryCount() 204 { 205 return _queryList.size(); 206 } 208 213 public org.openejb.alt.config.ejb11.ResourceLink getResourceLink(int index) 214 throws java.lang.IndexOutOfBoundsException 215 { 216 if ((index < 0) || (index > _resourceLinkList.size())) { 218 throw new IndexOutOfBoundsException (); 219 } 220 221 return (org.openejb.alt.config.ejb11.ResourceLink) _resourceLinkList.elementAt(index); 222 } 224 227 public org.openejb.alt.config.ejb11.ResourceLink[] getResourceLink() 228 { 229 int size = _resourceLinkList.size(); 230 org.openejb.alt.config.ejb11.ResourceLink[] mArray = new org.openejb.alt.config.ejb11.ResourceLink[size]; 231 for (int index = 0; index < size; index++) { 232 mArray[index] = (org.openejb.alt.config.ejb11.ResourceLink) _resourceLinkList.elementAt(index); 233 } 234 return mArray; 235 } 237 240 public int getResourceLinkCount() 241 { 242 return _resourceLinkList.size(); 243 } 245 248 public boolean isValid() 249 { 250 try { 251 validate(); 252 } 253 catch (org.exolab.castor.xml.ValidationException vex) { 254 return false; 255 } 256 return true; 257 } 259 264 public void marshal(java.io.Writer out) 265 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 266 { 267 268 Marshaller.marshal(this, out); 269 } 271 276 public void marshal(org.xml.sax.ContentHandler handler) 277 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 278 { 279 280 Marshaller.marshal(this, handler); 281 } 283 286 public void removeAllQuery() 287 { 288 _queryList.removeAllElements(); 289 } 291 294 public void removeAllResourceLink() 295 { 296 _resourceLinkList.removeAllElements(); 297 } 299 304 public org.openejb.alt.config.ejb11.Query removeQuery(int index) 305 { 306 java.lang.Object obj = _queryList.elementAt(index); 307 _queryList.removeElementAt(index); 308 return (org.openejb.alt.config.ejb11.Query) obj; 309 } 311 316 public org.openejb.alt.config.ejb11.ResourceLink removeResourceLink(int index) 317 { 318 java.lang.Object obj = _resourceLinkList.elementAt(index); 319 _resourceLinkList.removeElementAt(index); 320 return (org.openejb.alt.config.ejb11.ResourceLink) obj; 321 } 323 328 public void setContainerId(java.lang.String containerId) 329 { 330 this._containerId = containerId; 331 } 333 338 public void setDeploymentId(java.lang.String deploymentId) 339 { 340 this._deploymentId = deploymentId; 341 } 343 348 public void setEjbName(java.lang.String ejbName) 349 { 350 this._ejbName = ejbName; 351 } 353 359 public void setQuery(int index, org.openejb.alt.config.ejb11.Query vQuery) 360 throws java.lang.IndexOutOfBoundsException 361 { 362 if ((index < 0) || (index > _queryList.size())) { 364 throw new IndexOutOfBoundsException (); 365 } 366 _queryList.setElementAt(vQuery, index); 367 } 369 374 public void setQuery(org.openejb.alt.config.ejb11.Query[] queryArray) 375 { 376 _queryList.removeAllElements(); 378 for (int i = 0; i < queryArray.length; i++) { 379 _queryList.addElement(queryArray[i]); 380 } 381 } 383 389 public void setResourceLink(int index, org.openejb.alt.config.ejb11.ResourceLink vResourceLink) 390 throws java.lang.IndexOutOfBoundsException 391 { 392 if ((index < 0) || (index > _resourceLinkList.size())) { 394 throw new IndexOutOfBoundsException (); 395 } 396 _resourceLinkList.setElementAt(vResourceLink, index); 397 } 399 404 public void setResourceLink(org.openejb.alt.config.ejb11.ResourceLink[] resourceLinkArray) 405 { 406 _resourceLinkList.removeAllElements(); 408 for (int i = 0; i < resourceLinkArray.length; i++) { 409 _resourceLinkList.addElement(resourceLinkArray[i]); 410 } 411 } 413 418 public static java.lang.Object unmarshal(java.io.Reader reader) 419 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 420 { 421 return (org.openejb.alt.config.ejb11.EjbDeployment) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.EjbDeployment.class, reader); 422 } 424 427 public void validate() 428 throws org.exolab.castor.xml.ValidationException 429 { 430 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 431 validator.validate(this); 432 } 434 } 435 | Popular Tags |