KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > ConnectionDefDescriptor


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.deployment;
25
26 import com.sun.enterprise.deployment.xml.ConnectorTagNames;
27 import java.util.Iterator JavaDoc;
28 import java.util.Set JavaDoc;
29
30 /**
31  * Deployment Information for connection-definition
32  *
33  * <!ELEMENT connection-definition (
34  * managedconnectionfactory-class, connectionfactory-intf,
35  * connection-intf, config-property*, connectionfactory-impl, connection-impl
36  * )>
37  *
38  * @author Sheetal Vartak
39  */

40 public class ConnectionDefDescriptor extends Descriptor
41 {
42     private boolean isDirty = false;
43     
44     private String JavaDoc managedConnectionFactoryImpl = "";
45     private Set JavaDoc configProperties;
46     private String JavaDoc connectionIntf = "";
47     private String JavaDoc connectionImpl = "";
48     private String JavaDoc connectionfactoryImpl = "";
49     private String JavaDoc connectionfactoryIntf = "";
50
51     public ConnectionDefDescriptor ()
52     {
53         this.configProperties = new OrderedSet();
54     }
55
56     /**
57      * copy constructor
58      */

59     public ConnectionDefDescriptor(ConnectionDefDescriptor other)
60     {
61     super(other);
62     managedConnectionFactoryImpl = other.managedConnectionFactoryImpl; // String
63
connectionIntf = other.connectionIntf; // String
64
connectionImpl = other.connectionImpl; // String
65
connectionfactoryImpl = other.connectionfactoryImpl; // String
66
connectionfactoryIntf = other.connectionfactoryIntf; // String
67
configProperties = new OrderedSet();
68     if (other.configProperties != null) {
69         for (Iterator JavaDoc i = other.configProperties.iterator(); i.hasNext();) {
70             configProperties.add(new EnvironmentProperty((EnvironmentProperty)i.next()));
71         }
72     }
73     }
74
75     /**
76      * Gets the value of ManagedconnectionFactoryImpl
77      */

78     public String JavaDoc getManagedConnectionFactoryImpl()
79     {
80         return managedConnectionFactoryImpl;
81     }
82     
83     /**
84      * Sets the value of ManagedconnectionFactoryImpl
85      */

86     public void setManagedConnectionFactoryImpl(String JavaDoc managedConnectionFactoryImpl)
87     {
88         this.managedConnectionFactoryImpl = managedConnectionFactoryImpl;
89     this.setDirty();
90         this.changed();
91     }
92
93     /**
94      * Set of EnvironmentProperty
95      */

96     public Set JavaDoc getConfigProperties()
97     {
98         return configProperties;
99     }
100       
101     /**
102      * Add a configProperty to the set
103      */

104     public void addConfigProperty(EnvironmentProperty configProperty)
105     {
106     this.configProperties.add(configProperty);
107     this.setDirty();
108     this.changed();
109     }
110
111     /**
112      * Add a configProperty to the set
113      */

114     public void removeConfigProperty(EnvironmentProperty configProperty)
115     {
116     this.configProperties.remove(configProperty);
117     this.setDirty();
118     this.changed();
119     }
120     
121     /**
122      * Get connection factory impl
123      */

124     public String JavaDoc getConnectionFactoryImpl()
125     {
126         return this.connectionfactoryImpl;
127     }
128
129     /**
130      * set connection factory impl
131      */

132     public void setConnectionFactoryImpl(String JavaDoc cf)
133     {
134     this.connectionfactoryImpl = cf;
135     }
136
137     /**
138      * Get connection factory intf
139      */

140     public String JavaDoc getConnectionFactoryIntf()
141     {
142         return this.connectionfactoryIntf;
143     }
144
145     /**
146      * set connection factory intf
147      */

148     public void setConnectionFactoryIntf(String JavaDoc cf)
149     {
150     this.connectionfactoryIntf = cf;
151     }
152
153     /**
154      * Get connection intf
155      */

156     public String JavaDoc getConnectionIntf()
157     {
158         return this.connectionIntf;
159     }
160
161     /**
162      * set connection intf
163      */

164     public void setConnectionIntf(String JavaDoc con)
165     {
166     this.connectionIntf = con;
167     }
168
169     /**
170      * Get connection impl
171      */

172     public String JavaDoc getConnectionImpl()
173     {
174         return this.connectionImpl;
175     }
176
177     /**
178      * set connection intf
179      */

180     public void setConnectionImpl(String JavaDoc con)
181     {
182     this.connectionImpl = con;
183     }
184
185     public boolean isDirty()
186     {
187     return this.isDirty;
188     }
189     
190     public void changed()
191     {
192     super.changed();
193     }
194
195     private void setDirty() {
196         this.isDirty = true;
197     }
198
199  }
200
Popular Tags