KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > lib > deployment > BeanInfo


1 /*
2  * CoadunationLib: The coaduntion implementation library.
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * XMLConfigurationException.java
20  *
21  * BeanInfo.java
22  *
23  * The object responsible for storing the information about a Coaduantion bean.
24  */

25
26 package com.rift.coad.lib.deployment;
27
28 // java imports
29
import java.util.List JavaDoc;
30 import java.util.ArrayList JavaDoc;
31 import java.util.Vector JavaDoc;
32
33
34 /**
35  * The object that stores the information about a Coadunation bean.
36  *
37  * @author Brett Chaldecott
38  */

39 public class BeanInfo {
40     
41     // the classes private member variables
42
private String JavaDoc interfaceName = null;
43     private String JavaDoc className = null;
44     private Vector JavaDoc classes = new Vector JavaDoc();
45     private String JavaDoc bindName = null;
46     private String JavaDoc role = null;
47     private String JavaDoc username = null;
48     private boolean cacheResults = false;
49     private long cacheTimeout = -1;
50     private List JavaDoc threadInfoList = new ArrayList JavaDoc();
51     private boolean transaction = false;
52     
53     
54     /**
55      * Creates a new instance of BeanInfo.
56      */

57     public BeanInfo() {
58         
59     }
60         
61     
62     /**
63      * The getter method for the interface name.
64      *
65      * @return The string containing the interface name.
66      */

67     public String JavaDoc getInterfaceName() {
68         return interfaceName;
69     }
70     
71     
72     /**
73      * The setter method for the interface name variable.
74      *
75      * @param interfaceName The interface name to set.
76      */

77     public void setInterfaceName(String JavaDoc interfaceName) {
78         this.interfaceName = interfaceName;
79     }
80     
81     
82     /**
83      * The getter method for the class name.
84      *
85      * @return The string containing the class name.
86      */

87     public String JavaDoc getClassName() {
88         return className;
89     }
90     
91     
92     /**
93      * This setter method for the class name member variable.
94      *
95      * @param className The name value for the class to set.
96      */

97     public void setClassName(String JavaDoc className) {
98         this.className = className;
99     }
100     
101     
102     /**
103      * The getter method for the list of classes.
104      *
105      * @return The vector containing the list of classes.
106      */

107     public Vector JavaDoc getClasses() {
108         return classes;
109     }
110     
111     
112     /**
113      * The setter method of the extra classes.
114      *
115      * @param classes The list of classes.
116      */

117     public void setClasses(Vector JavaDoc classes) {
118         this.classes = classes;
119     }
120     
121     
122     /**
123      * The setter method of the extra classes.
124      *
125      * @param classes The list of classes.
126      */

127     public void addClass(String JavaDoc className) {
128         this.classes.add(className);
129     }
130     
131     
132     /**
133      * The getter method for the bind name.
134      *
135      * @return The string containing the bind name.
136      */

137     public String JavaDoc getBindName() {
138         return bindName;
139     }
140     
141     
142     /**
143      * The setter method for the bind name member variable.
144      *
145      * @param bindName The name of the bind variable.
146      */

147     public void setBindName(String JavaDoc bindName) {
148         this.bindName = bindName;
149     }
150     
151     
152     /**
153      * The getter method for the role name.
154      *
155      * @return The string containing the role name.
156      */

157     public String JavaDoc getRole() {
158         return role;
159     }
160     
161     
162     /**
163      * The setter method for the role name.
164      *
165      * @param The name of the role to set.
166      */

167     public void setRole(String JavaDoc role) {
168         this.role = role;
169     }
170     
171     
172     /**
173      * The name of the user that this bean will run as.
174      *
175      * @return The string containing the username information.
176      */

177     public String JavaDoc getUsername() {
178         return username;
179     }
180     
181     
182     /**
183      * This method sets the username for the bean.
184      *
185      * @param username The name of the user that the bean will run as.
186      */

187     public void setUsername(String JavaDoc username) {
188         this.username = username;
189     }
190     
191     
192     /**
193      * The getter for the cache results method.
194      *
195      * @return TRUE if set, FALSE if not.
196      */

197     public boolean getCacheResults() {
198         return cacheResults;
199     }
200     
201     
202     /**
203      * The setter method for the cache results object.
204      *
205      * @param cacheResults The value to set the cache results flag to.
206      */

207     public void setCacheResults(boolean cacheResults) {
208         this.cacheResults = cacheResults;
209     }
210     
211     
212     /**
213      * The getter for the cache time out.
214      *
215      * @return A long containing the cache timeout information.
216      */

217     public long getCacheTimeout() {
218         return cacheTimeout;
219     }
220     
221     
222     /**
223      * The setter method for the cache time out.
224      *
225      * @param cacheResults The value to set the cache results flag to.
226      */

227     public void setCacheTimeout(long cacheTimeout) {
228         this.cacheTimeout= cacheTimeout;
229     }
230     
231     
232     /**
233      * The list of threads.
234      *
235      * @return The list of threads for this bean.
236      */

237     public List JavaDoc getThreadInfoList() {
238         return threadInfoList;
239     }
240     
241     
242     /**
243      * This method will add a thread to the list of threads.
244      *
245      * @param threadInfo The thread information to add to the list.
246      */

247     public void addThreadInfo(DeploymentThreadInfo threadInfo) {
248        threadInfoList.add(threadInfo);
249     }
250     
251     
252     /**
253      * This method returns true if the container must control the transaction.
254      *
255      * @return TRUE if it must control the transaction.
256      */

257     public boolean getTransaction() {
258         return transaction;
259     }
260     
261     
262     /**
263      * This method sets the transaction
264      *
265      * @param TRUE if this container must control the transaction.
266      */

267     public void setTransaction(boolean transaction) {
268         this.transaction = transaction;
269     }
270     
271     /**
272      * This method will return true if all the member variables have been
273      * initialized.
274      *
275      * @return TRUE if initialized FALSE if not.
276      */

277     public boolean isInitialized() {
278         if ((interfaceName != null) && (className != null) && (bindName != null)
279             && (role != null)) {
280             return true;
281         }
282         return false;
283     }
284 }
285
Popular Tags