KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > dd > impl > client > AppClientProxy


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.dd.impl.client;
21
22 /**
23  *
24  * @author Nitya Doraisamy
25  */

26 import java.util.Iterator JavaDoc;
27 import org.netbeans.modules.j2ee.dd.api.client.AppClient;
28 import org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException;
29 import org.openide.filesystems.FileAlreadyLockedException;
30 import org.openide.filesystems.FileObject;
31
32 public class AppClientProxy implements AppClient {
33     
34     private AppClient app;
35     private String JavaDoc version;
36     private java.util.List JavaDoc listeners;
37     public boolean writing=false;
38     private OutputProvider outputProvider;
39     private org.xml.sax.SAXParseException JavaDoc error;
40     private int ddStatus;
41     
42 // private static CommonDDAccess cDDA = new
43

44     /**
45      * Creates a new instance of AppClientProxy
46      *
47      */

48     public AppClientProxy(AppClient app, String JavaDoc version) {
49         this.app = app;
50         this.version = version;
51         listeners = new java.util.ArrayList JavaDoc();
52     }
53     
54     public void setOriginal(AppClient app) {
55         if (this.app != app) {
56             for (Iterator JavaDoc i = listeners.iterator(); i.hasNext();) {
57                 java.beans.PropertyChangeListener JavaDoc pcl =
58                         (java.beans.PropertyChangeListener JavaDoc) i.next();
59                 if (this.app != null) this.app.removePropertyChangeListener(pcl);
60                 if (app != null) app.addPropertyChangeListener(pcl);
61                 
62             }
63             this.app = app;
64             if (app != null) setProxyVersion(app.getVersion().toString());
65         }
66     }
67     
68     public AppClient getOriginal() {
69         return app;
70     }
71     
72     public void setProxyVersion(java.lang.String JavaDoc value) {
73         if ((version==null && value!=null) || !version.equals(value)) {
74             java.beans.PropertyChangeEvent JavaDoc evt =
75                     new java.beans.PropertyChangeEvent JavaDoc(this, PROPERTY_VERSION, version, value);
76             version=value;
77             for (Iterator JavaDoc i = listeners.iterator(); i.hasNext();) {
78                 ((java.beans.PropertyChangeListener JavaDoc) i.next()).propertyChange(evt);
79             }
80         }
81     }
82     
83     
84     public org.netbeans.modules.j2ee.dd.api.common.CommonDDBean addBean(String JavaDoc beanName) throws ClassNotFoundException JavaDoc {
85         return app==null?null:app.addBean(beanName);
86     }
87     
88     public org.netbeans.modules.j2ee.dd.api.common.CommonDDBean addBean(String JavaDoc beanName, String JavaDoc[] propertyNames, Object JavaDoc[] propertyValues, String JavaDoc keyProperty) throws ClassNotFoundException JavaDoc, org.netbeans.modules.j2ee.dd.api.common.NameAlreadyUsedException {
89         return app==null?null:app.addBean(beanName, propertyNames, propertyValues, keyProperty);
90     }
91     
92     public int addIcon(org.netbeans.modules.j2ee.dd.api.common.Icon value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
93         return app==null?-1:app.addIcon(value);
94     }
95     
96     public void addPropertyChangeListener(java.beans.PropertyChangeListener JavaDoc pcl) {
97         if (app != null) app.addPropertyChangeListener(pcl);
98         listeners.add(pcl);
99     }
100     
101     public org.netbeans.modules.j2ee.dd.api.common.CommonDDBean createBean(String JavaDoc beanName) throws ClassNotFoundException JavaDoc {
102         return app==null?null:app.createBean(beanName);
103     }
104     
105     public org.netbeans.modules.j2ee.dd.api.common.CommonDDBean findBeanByName(String JavaDoc beanName, String JavaDoc propertyName, String JavaDoc value) {
106         return app==null?null:app.findBeanByName(beanName, propertyName, value);
107     }
108     
109     public java.util.Map JavaDoc getAllDescriptions() {
110         return app==null?new java.util.HashMap JavaDoc():app.getAllDescriptions();
111     }
112     
113     public java.util.Map JavaDoc getAllDisplayNames() {
114         return app==null?new java.util.HashMap JavaDoc():app.getAllDisplayNames();
115     }
116     
117     public java.util.Map JavaDoc getAllIcons() {
118         return app==null?new java.util.HashMap JavaDoc():app.getAllIcons();
119     }
120     
121     public String JavaDoc getDefaultDescription() {
122         return app==null?null:app.getDefaultDescription();
123     }
124     
125     public String JavaDoc getDefaultDisplayName() {
126         return app==null?null:app.getDefaultDisplayName();
127     }
128     
129     public org.netbeans.modules.j2ee.dd.api.common.Icon getDefaultIcon() {
130         return app==null?null:app.getDefaultIcon();
131     }
132     
133     public String JavaDoc getDescription(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
134         return app==null?null:app.getDescription(locale);
135     }
136     
137     public String JavaDoc getDisplayName(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
138         return app==null?null:app.getDisplayName(locale);
139     }
140     
141     public org.xml.sax.SAXParseException JavaDoc getError() {
142         return error;
143     }
144     
145     public void setError(org.xml.sax.SAXParseException JavaDoc error) {
146         this.error=error;
147     }
148     
149     public org.netbeans.modules.j2ee.dd.api.common.Icon getIcon(int index) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
150         return app==null?null:app.getIcon(index);
151     }
152     
153     public String JavaDoc getId() {
154         return app==null?null:app.getId();
155     }
156     
157     public String JavaDoc getLargeIcon() {
158         return app==null?null:app.getLargeIcon();
159     }
160     
161     public String JavaDoc getLargeIcon(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
162         return app==null?null:app.getLargeIcon(locale);
163     }
164     
165     public String JavaDoc getSmallIcon() {
166         return app==null?null:app.getSmallIcon();
167     }
168     
169     public String JavaDoc getSmallIcon(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
170         return app==null?null:app.getSmallIcon(locale);
171     }
172     
173     public int getStatus() {
174         return ddStatus;
175     }
176     
177     public void setStatus(int value) {
178         if (ddStatus!=value) {
179             java.beans.PropertyChangeEvent JavaDoc evt =
180                     new java.beans.PropertyChangeEvent JavaDoc(this, PROPERTY_STATUS, new Integer JavaDoc(ddStatus), new Integer JavaDoc(value));
181             ddStatus=value;
182             for (Iterator JavaDoc i = listeners.iterator(); i.hasNext();) {
183                 ((java.beans.PropertyChangeListener JavaDoc) i.next()).propertyChange(evt);
184             }
185         }
186     }
187     
188     public Object JavaDoc getValue(String JavaDoc propertyName) {
189         return app==null?null:app.getValue(propertyName);
190     }
191     
192     public java.math.BigDecimal JavaDoc getVersion() {
193         return new java.math.BigDecimal JavaDoc(version);
194     }
195     
196     public void merge(org.netbeans.modules.j2ee.dd.api.common.RootInterface root, int mode) {
197         if (app!=null) {
198             if (root instanceof AppClientProxy)
199                 app.merge(((AppClientProxy)root).getOriginal(), mode);
200             else app.merge(root, mode);
201         }
202     }
203     
204     public org.netbeans.modules.j2ee.dd.api.common.Icon newIcon() {
205         try {
206             return app==null?null:app.newIcon();
207         } catch (VersionNotSupportedException vnse) {
208             return null;
209         }
210     }
211     
212     public void removeAllDescriptions() {
213         if (app!=null) app.removeAllDescriptions();
214     }
215     
216     public void removeAllDisplayNames() {
217         if (app!=null) app.removeAllDisplayNames();
218     }
219     
220     public void removeAllIcons() {
221         if (app!=null) app.removeAllIcons();
222     }
223     
224     public void removeDescription() {
225         if (app!=null) app.removeDescription();
226     }
227     
228     public void removeDescriptionForLocale(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
229         if (app!=null) app.removeDescriptionForLocale(locale);
230     }
231     
232     public void removeDisplayName() {
233         if (app!=null) app.removeDisplayName();
234     }
235     
236     public void removeDisplayNameForLocale(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
237         if (app!=null) app.removeDisplayNameForLocale(locale);
238     }
239     
240     public void removeIcon() {
241         if (app!=null) app.removeIcon();
242     }
243     
244     public int removeIcon(org.netbeans.modules.j2ee.dd.api.common.Icon value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
245         return app==null?-1:app.removeIcon(value);
246     }
247     
248     public void removeIcon(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
249         if (app!=null) app.removeIcon(locale);
250     }
251     
252     public void removeLargeIcon() {
253         if (app!=null) app.removeLargeIcon();
254     }
255     
256     public void removeLargeIcon(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
257         if (app!=null) app.removeLargeIcon(locale);
258     }
259     
260     public void removePropertyChangeListener(java.beans.PropertyChangeListener JavaDoc pcl) {
261         if (app != null) app.removePropertyChangeListener(pcl);
262         listeners.remove(pcl);
263     }
264     
265     public void removeSmallIcon() {
266         if (app != null) app.removeSmallIcon();
267     }
268     
269     public void removeSmallIcon(String JavaDoc locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
270         if (app != null) app.removeSmallIcon(locale);
271     }
272     
273     public void setAllDescriptions(java.util.Map JavaDoc descriptions) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
274         if (app != null) app.setAllDescriptions(descriptions);
275     }
276     
277     public void setAllDisplayNames(java.util.Map JavaDoc displayNames) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
278         if (app != null) app.setAllDisplayNames(displayNames);
279     }
280     
281     public void setAllIcons(String JavaDoc[] locales, String JavaDoc[] smallIcons, String JavaDoc[] largeIcons) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
282         if (app != null) app.setAllIcons(locales, smallIcons, largeIcons);
283     }
284     
285     public void setDescription(String JavaDoc description) {
286         if (app != null) app.setDescription(description);
287     }
288     
289     public void setDescription(String JavaDoc locale, String JavaDoc description) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
290         if (app != null) app.setDescription(locale, description);
291     }
292     
293     public void setDisplayName(String JavaDoc displayName) {
294         if (app != null) app.setDisplayName(displayName);
295     }
296     
297     public void setDisplayName(String JavaDoc locale, String JavaDoc displayName) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
298         if (app != null) app.setDisplayName(locale, displayName);
299     }
300     
301     public void setIcon(org.netbeans.modules.j2ee.dd.api.common.Icon[] value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
302         if (app != null) app.setIcon(value);
303     }
304     
305     public void setIcon(org.netbeans.modules.j2ee.dd.api.common.Icon icon) {
306         if (app != null) app.setIcon(icon);
307     }
308     
309     public void setIcon(int index, org.netbeans.modules.j2ee.dd.api.common.Icon value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
310         if (app != null) app.setIcon(index, value);
311     }
312     
313     public void setId(String JavaDoc value) {
314         if (app != null) app.setId(value);
315     }
316     
317     public void setLargeIcon(String JavaDoc icon) {
318         if (app != null) app.setLargeIcon(icon);
319     }
320     
321     public void setLargeIcon(String JavaDoc locale, String JavaDoc icon) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
322         if (app != null) app.setLargeIcon(locale, icon);
323     }
324     
325     public void setSmallIcon(String JavaDoc icon) {
326         if (app != null) app.setSmallIcon(icon);
327     }
328     
329     public void setSmallIcon(String JavaDoc locale, String JavaDoc icon) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
330         if (app != null) app.setSmallIcon(locale, icon);
331     }
332     
333     public int sizeIcon() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
334         return app==null?0:app.sizeIcon();
335     }
336     
337     public void write(FileObject fo) throws java.io.IOException JavaDoc {
338         if (app != null) {
339             try {
340                 org.openide.filesystems.FileLock lock = fo.lock();
341                 try {
342                     java.io.OutputStream JavaDoc os = fo.getOutputStream(lock);
343                     try {
344                         writing=true;
345                         write(os);
346                     } finally {
347                         os.close();
348                     }
349                 } finally {
350                     lock.releaseLock();
351                 }
352             } catch (FileAlreadyLockedException ex) {
353                 // trying to use OutputProvider for writing changes
354
org.openide.loaders.DataObject dobj = org.openide.loaders.DataObject.find(fo);
355                 if (dobj!=null && dobj instanceof AppClientProxy.OutputProvider)
356                     ((AppClientProxy.OutputProvider)dobj).write(this);
357                 else throw ex;
358             }
359         }
360     }
361     
362     public void write(java.io.OutputStream JavaDoc os) throws java.io.IOException JavaDoc {
363         if (app != null) {
364             writing=true;
365             app.write(os);
366         }
367     }
368     
369     public Object JavaDoc clone() {
370         AppClientProxy proxy = null;
371         if (app == null)
372             proxy = new AppClientProxy(null,version);
373         else {
374             AppClientProxy clonedApp=(AppClientProxy)app.clone();
375             proxy = new AppClientProxy(clonedApp, version);
376         }
377         proxy.setError(error);
378         proxy.setStatus(ddStatus);
379         return proxy;
380     }
381     
382     public boolean isWriting() {
383         return writing;
384     }
385     
386     public void setWriting(boolean writing) {
387         this.writing=writing;
388     }
389     
390     public void setOutputProvider(OutputProvider iop) {
391         this.outputProvider=iop;
392     }
393     
394     public int addEjbRef(org.netbeans.modules.j2ee.dd.api.common.EjbRef value) {
395         return app==null?-1:app.addEjbRef(value);
396     }
397     
398     public int addEnvEntry(org.netbeans.modules.j2ee.dd.api.common.EnvEntry value) {
399         return app==null?-1:app.addEnvEntry(value);
400     }
401     
402     public int addMessageDestination(org.netbeans.modules.j2ee.dd.api.common.MessageDestination value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
403         return app==null?-1:app.addMessageDestination(value);
404     }
405     
406     public int addMessageDestinationRef(org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef value) throws VersionNotSupportedException {
407         return app==null?-1:app.addMessageDestinationRef(value);
408     }
409     
410     public int addResourceEnvRef(org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef value) {
411         return app==null?-1:app.addResourceEnvRef(value);
412     }
413     
414     public int addResourceRef(org.netbeans.modules.j2ee.dd.api.common.ResourceRef value) {
415         return app==null?-1:app.addResourceRef(value);
416     }
417     
418     public int addServiceRef(org.netbeans.modules.j2ee.dd.api.common.ServiceRef value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
419         return app==null?-1:app.addServiceRef(value);
420     }
421     
422     public String JavaDoc getCallbackHandler() {
423         return (app != null) ? app.getCallbackHandler() : null;
424     }
425     
426     public org.netbeans.modules.j2ee.dd.api.common.EjbRef[] getEjbRef() {
427         return (app != null) ? app.getEjbRef() : null;
428     }
429     
430     public org.netbeans.modules.j2ee.dd.api.common.EjbRef getEjbRef(int index) {
431         return (app != null) ? app.getEjbRef(index) : null;
432     }
433     
434     public org.netbeans.modules.j2ee.dd.api.common.EnvEntry[] getEnvEntry() {
435         return app==null?new org.netbeans.modules.j2ee.dd.api.common.EnvEntry[0]:app.getEnvEntry();
436     }
437     
438     public org.netbeans.modules.j2ee.dd.api.common.EnvEntry getEnvEntry(int index) {
439         return app==null?null:app.getEnvEntry(index);
440     }
441     
442     public org.netbeans.modules.j2ee.dd.api.common.MessageDestination[] getMessageDestination() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
443         return app==null?new org.netbeans.modules.j2ee.dd.api.common.MessageDestination[0]:app.getMessageDestination();
444     }
445     
446     public org.netbeans.modules.j2ee.dd.api.common.MessageDestination getMessageDestination(int index) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
447         return app==null?null:app.getMessageDestination(index);
448     }
449     
450     public org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef[] getMessageDestinationRef() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
451         return app==null?new org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef[0]:app.getMessageDestinationRef();
452     }
453     
454     public org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef getMessageDestinationRef(int index) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
455         return app==null?null:app.getMessageDestinationRef(index);
456     }
457     
458     public org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef[] getResourceEnvRef() {
459         return app==null?null:app==null?new org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef[0]:app.getResourceEnvRef();
460     }
461     
462     public org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef getResourceEnvRef(int index) {
463         return app==null?null:app.getResourceEnvRef(index);
464     }
465     
466     public org.netbeans.modules.j2ee.dd.api.common.ResourceRef[] getResourceRef() {
467         return app==null?new org.netbeans.modules.j2ee.dd.api.common.ResourceRef[0]:app.getResourceRef();
468     }
469     
470     public org.netbeans.modules.j2ee.dd.api.common.ResourceRef getResourceRef(int index) {
471         return app==null?null:app.getResourceRef(index);
472     }
473     
474     public org.netbeans.modules.j2ee.dd.api.common.ServiceRef[] getServiceRef() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
475         return app==null?new org.netbeans.modules.j2ee.dd.api.common.ServiceRef[0]:app.getServiceRef();
476     }
477     
478     public org.netbeans.modules.j2ee.dd.api.common.ServiceRef getServiceRef(int index) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
479         return app==null?null:app.getServiceRef(index);
480     }
481     
482     public org.netbeans.modules.j2ee.dd.api.common.EjbRef newEjbRef() {
483         return (app != null) ? app.newEjbRef() : null;
484     }
485     
486     public org.netbeans.modules.j2ee.dd.api.common.EnvEntry newEnvEntry() {
487         return (app != null) ? app.newEnvEntry() : null;
488     }
489     
490     public org.netbeans.modules.j2ee.dd.api.common.MessageDestination newMessageDestination() throws VersionNotSupportedException {
491         return (app != null) ? app.newMessageDestination() : null;
492     }
493     
494     public org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef newMessageDestinationRef() throws VersionNotSupportedException {
495         return (app != null) ? app.newMessageDestinationRef() : null;
496     }
497     
498     public org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef newResourceEnvRef() {
499         return (app != null) ? app.newResourceEnvRef() : null;
500     }
501     
502     public org.netbeans.modules.j2ee.dd.api.common.ResourceRef newResourceRef() {
503         return (app != null) ? app.newResourceRef() : null;
504     }
505     
506     public org.netbeans.modules.j2ee.dd.api.common.ServiceRef newServiceRef() throws VersionNotSupportedException {
507         return (app != null) ? app.newServiceRef() : null;
508     }
509     
510     public int removeEjbRef(org.netbeans.modules.j2ee.dd.api.common.EjbRef value) {
511         return app==null?-1:app.removeEjbRef(value);
512     }
513     
514     public int removeEnvEntry(org.netbeans.modules.j2ee.dd.api.common.EnvEntry value) {
515         return app==null?-1:app.removeEnvEntry(value);
516     }
517     
518     public int removeMessageDestination(org.netbeans.modules.j2ee.dd.api.common.MessageDestination value) throws VersionNotSupportedException {
519         return app==null?-1:app.removeMessageDestination(value);
520     }
521     
522     public int removeMessageDestinationRef(org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef value) throws VersionNotSupportedException {
523         return app==null?-1:app.removeMessageDestinationRef(value);
524     }
525     
526     public int removeResourceEnvRef(org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef value) {
527         return app==null?-1:app.removeResourceEnvRef(value);
528     }
529     
530     public int removeResourceRef(org.netbeans.modules.j2ee.dd.api.common.ResourceRef value) {
531         return app==null?-1:app.removeResourceRef(value);
532     }
533     
534     public int removeServiceRef(org.netbeans.modules.j2ee.dd.api.common.ServiceRef value) throws VersionNotSupportedException {
535         return app==null?-1:app.removeServiceRef(value);
536     }
537     
538     public void setVersion(java.math.BigDecimal JavaDoc version) {
539         if (app != null) app.setVersion(version);
540     }
541     
542     public void setEjbRef(org.netbeans.modules.j2ee.dd.api.common.EjbRef[] value) {
543         if (app != null) { app.setEjbRef(value); }
544     }
545     
546     public void setResourceRef(int index, org.netbeans.modules.j2ee.dd.api.common.ResourceRef value) {
547         if (app!=null) app.setResourceRef(index, value);
548     }
549     
550     public void setResourceEnvRef(org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef[] value) {
551         if (app!=null) app.setResourceEnvRef(value);
552     }
553     
554     public void setServiceRef(int index, org.netbeans.modules.j2ee.dd.api.common.ServiceRef value) throws VersionNotSupportedException {
555         if (app!=null) app.setServiceRef(index, value);
556     }
557     
558     public void setMessageDestination(org.netbeans.modules.j2ee.dd.api.common.MessageDestination[] value) throws VersionNotSupportedException {
559         if (app!=null) app.setMessageDestination(value);
560     }
561     
562     public void setResourceEnvRef(int index, org.netbeans.modules.j2ee.dd.api.common.ResourceEnvRef value) {
563         if (app!=null) app.setResourceEnvRef(index, value);
564     }
565     
566     public void setEnvEntry(org.netbeans.modules.j2ee.dd.api.common.EnvEntry[] value) {
567         if (app!=null) app.setEnvEntry(value);
568     }
569     
570     public void setMessageDestination(int index, org.netbeans.modules.j2ee.dd.api.common.MessageDestination value) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
571         if (app!=null) app.setMessageDestination(index, value);
572     }
573     
574     public void setMessageDestinationRef(org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef[] value) throws VersionNotSupportedException {
575         if (app!=null) app.setMessageDestinationRef(value);
576     }
577     
578     public void setMessageDestinationRef(int index, org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef value) throws VersionNotSupportedException {
579         if (app!=null) app.setMessageDestinationRef(index, value);
580     }
581     
582     public void setEnvEntry(int index, org.netbeans.modules.j2ee.dd.api.common.EnvEntry value) {
583         if (app!=null) app.setEnvEntry(index, value);
584     }
585     
586     public void setEjbRef(int index, org.netbeans.modules.j2ee.dd.api.common.EjbRef value) {
587         if (app != null) app.setEjbRef(index, value);
588     }
589     
590     public void setCallbackHandler(String JavaDoc value) {
591         if (app!=null) app.setCallbackHandler(value);
592     }
593     
594     public void setServiceRef(org.netbeans.modules.j2ee.dd.api.common.ServiceRef[] value) throws VersionNotSupportedException {
595         if (app!=null) app.setServiceRef(value);
596     }
597     
598     public void setResourceRef(org.netbeans.modules.j2ee.dd.api.common.ResourceRef[] value) {
599         if (app!=null) app.setResourceRef(value);
600     }
601     
602     public int sizeEjbRef() {
603         return (app != null) ? app.sizeEjbRef() : 0;
604     }
605     
606     public int sizeEnvEntry() {
607         return app==null?0:app.sizeEnvEntry();
608     }
609     
610     public int sizeMessageDestination() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
611         return app==null?0:app.sizeMessageDestination();
612     }
613     
614     public int sizeMessageDestinationRef() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
615         return app==null?0:app.sizeMessageDestinationRef();
616     }
617     
618     public int sizeResourceEnvRef() {
619         return app==null?0:app.sizeResourceEnvRef();
620     }
621     
622     public int sizeResourceRef() {
623         return app==null?0:app.sizeResourceRef();
624     }
625     
626     public int sizeServiceRef() throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
627         return app==null?0:app.sizeServiceRef();
628     }
629     
630     /** Contract between friend modules that enables
631      * a specific handling of write(FileObject) method for targeted FileObject
632      */

633     public static interface OutputProvider {
634         public void write(AppClient app) throws java.io.IOException JavaDoc;
635         public FileObject getTarget();
636     }
637 }
638
Popular Tags