KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsdl > config > api > CommonDDBean


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.websvc.wsdl.config.api;
21 /**
22  * Parent of all Config Bean API interfaces. Inspired by (and heavily copied from)
23  * CommonDDBean in web/ddapi
24  *
25  *<p><b><font color="red"><em>Important note: Do not provide an implementation of this interface.</em></font></b>
26  *</p>
27  *
28  * @author Peter Williams
29  *
30  */

31 public interface CommonDDBean {
32     /**
33      * Adds property change listener to particular CommonDDBean object (WebApp object).
34      * @param pcl property change listener
35      */

36     public void addPropertyChangeListener(java.beans.PropertyChangeListener JavaDoc pcl);
37     /**
38      * Removes property change listener from CommonDDBean object.
39      * @param pcl property change listener
40      */

41     public void removePropertyChangeListener(java.beans.PropertyChangeListener JavaDoc pcl);
42     /**
43      * Sets the id attribute for related dd element. E.g.<pre>
44 &lt;servlet id="xyz"&gt;
45   ...
46 &lt;/servlet&gt;
47      *</pre>
48      *
49      * @param value the value for id attribute
50      */

51 // !PW I don't think this method is needed for configuration schema
52
// public void setId(java.lang.String value);
53
/**
54      * Returns the id attribute for related dd element.<br>In most cases the id attribute is not specified.
55      * @return value of id attribute or null if not specified
56      */

57 // public java.lang.String getId();
58
/**
59      * Returns the clonned CommonDDBean object.
60      * @return the clonned (not bound to bean graph) CommonDDBean object
61      */

62     public Object JavaDoc clone();
63     /**
64      * Returns the CommonDDBean object or array of CommonDDBean object for given property.<br>
65      * E.g. for retrieving the servlet-class value on Servlet object he <b>getValue("ServletClass");</b> can be used.
66      * @param propertyName name of the property the value is looking for
67      * @return the bean/array of beans related to given property
68      */

69     public Object JavaDoc getValue(String JavaDoc propertyName);
70     /**
71      * Writes the whole DD or its fraction (element related to CommonDDBean) to output stream.<br>
72      * For DD root object there is more convenient to use the {@link org.netbeans.modules.j2ee.dd.api.common.RootInterface#write} method.<br>
73      * The correct usage with file objects is :<pre>
74 WebApp webApp;
75 FileObject fo;
76 ...
77 // code that initializes and modifies the webApp object
78 ...
79 FileLock lock;
80 try {
81     lock=fo.lock();
82 } catch (FileAlreadyLockedException e) {
83     // handling the exception
84 }
85 if (lock!=null) {
86     try {
87         OutputStream os=fo.getOutputStream(lock);
88         try {
89             webApp.write(os);
90         } finally {
91             os.close();
92         }
93     } finally {
94         lock.releaseLock();
95     }
96 }
97 ...
98      *</pre>
99      * @param os output stream for writing
100      */

101     public void write(java.io.OutputStream JavaDoc os) throws java.io.IOException JavaDoc;
102
103 }
104
Popular Tags