KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > tests > j2eeserver > plugin > jsr88 > ResourceManager


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
21 package org.netbeans.tests.j2eeserver.plugin.jsr88;
22
23 import java.beans.*;
24
25 /**
26  *
27  * @author George Finklang
28  */

29 public class ResourceManager extends Object JavaDoc implements java.io.Serializable JavaDoc {
30
31     private static final String JavaDoc PROP_SAMPLE_PROPERTY = "SampleProperty";
32
33     private PropertyChangeSupport propertySupport;
34
35     /** Holds value of property resourceName. */
36     private String JavaDoc resourceName;
37
38     /** Holds value of property resourceJndiName. */
39     private String JavaDoc resourceJndiName;
40
41     /** Holds value of property resourceUrl. */
42     private String JavaDoc resourceUrl;
43
44     /** Creates new ResourceManager */
45     public ResourceManager(String JavaDoc resourceName) {
46         this.resourceName = resourceName;
47         propertySupport = new PropertyChangeSupport( this );
48     }
49
50
51     public void addPropertyChangeListener(PropertyChangeListener listener) {
52         propertySupport.addPropertyChangeListener(listener);
53     }
54
55     public void removePropertyChangeListener(PropertyChangeListener listener) {
56         propertySupport.removePropertyChangeListener(listener);
57     }
58
59     /** Getter for property resourceName.
60      * @return Value of property resourceName.
61      */

62     public String JavaDoc getResourceName() {
63         return this.resourceName;
64     }
65
66     /** Getter for property resourceJndiName.
67      * @return Value of property resourceJndiName.
68      */

69     public String JavaDoc getResourceJndiName() {
70         return this.resourceJndiName;
71     }
72
73     /** Setter for property resourceJndiName.
74      * @param resourceJndiName New value of property resourceJndiName.
75      */

76     public void setResourceJndiName(String JavaDoc resourceJndiName) {
77         String JavaDoc oldResourceJndiName = this.resourceJndiName;
78         this.resourceJndiName = resourceJndiName;
79         propertySupport.firePropertyChange("resourceJndiName", oldResourceJndiName, resourceJndiName);
80     }
81
82     /** Getter for property resourceUrl.
83      * @return Value of property resourceUrl.
84      */

85     public String JavaDoc getResourceUrl() {
86         return this.resourceUrl;
87     }
88
89     /** Setter for property resourceUrl.
90      * @param resourceUrl New value of property resourceUrl.
91      */

92     public void setResourceUrl(String JavaDoc resourceUrl) {
93         String JavaDoc oldResourceUrl = this.resourceUrl;
94         this.resourceUrl = resourceUrl;
95         propertySupport.firePropertyChange("resourceUrl", oldResourceUrl, resourceUrl);
96     }
97
98 }
99
Popular Tags