001: /*
002: * CoadunationLib: The coaduntion implementation library.
003: * Copyright (C) 2006 Rift IT Contracting
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
018: *
019: * XMLConfigurationException.java
020: *
021: * BeanInfo.java
022: *
023: * The object responsible for storing the information about a Coaduantion bean.
024: */
025:
026: package com.rift.coad.lib.deployment;
027:
028: // java imports
029: import java.util.List;
030: import java.util.ArrayList;
031: import java.util.Vector;
032:
033: /**
034: * The object that stores the information about a Coadunation bean.
035: *
036: * @author Brett Chaldecott
037: */
038: public class BeanInfo {
039:
040: // the classes private member variables
041: private String interfaceName = null;
042: private String className = null;
043: private Vector classes = new Vector();
044: private String bindName = null;
045: private String role = null;
046: private String username = null;
047: private boolean cacheResults = false;
048: private long cacheTimeout = -1;
049: private List threadInfoList = new ArrayList();
050: private boolean transaction = false;
051:
052: /**
053: * Creates a new instance of BeanInfo.
054: */
055: public BeanInfo() {
056:
057: }
058:
059: /**
060: * The getter method for the interface name.
061: *
062: * @return The string containing the interface name.
063: */
064: public String getInterfaceName() {
065: return interfaceName;
066: }
067:
068: /**
069: * The setter method for the interface name variable.
070: *
071: * @param interfaceName The interface name to set.
072: */
073: public void setInterfaceName(String interfaceName) {
074: this .interfaceName = interfaceName;
075: }
076:
077: /**
078: * The getter method for the class name.
079: *
080: * @return The string containing the class name.
081: */
082: public String getClassName() {
083: return className;
084: }
085:
086: /**
087: * This setter method for the class name member variable.
088: *
089: * @param className The name value for the class to set.
090: */
091: public void setClassName(String className) {
092: this .className = className;
093: }
094:
095: /**
096: * The getter method for the list of classes.
097: *
098: * @return The vector containing the list of classes.
099: */
100: public Vector getClasses() {
101: return classes;
102: }
103:
104: /**
105: * The setter method of the extra classes.
106: *
107: * @param classes The list of classes.
108: */
109: public void setClasses(Vector classes) {
110: this .classes = classes;
111: }
112:
113: /**
114: * The setter method of the extra classes.
115: *
116: * @param classes The list of classes.
117: */
118: public void addClass(String className) {
119: this .classes.add(className);
120: }
121:
122: /**
123: * The getter method for the bind name.
124: *
125: * @return The string containing the bind name.
126: */
127: public String getBindName() {
128: return bindName;
129: }
130:
131: /**
132: * The setter method for the bind name member variable.
133: *
134: * @param bindName The name of the bind variable.
135: */
136: public void setBindName(String bindName) {
137: this .bindName = bindName;
138: }
139:
140: /**
141: * The getter method for the role name.
142: *
143: * @return The string containing the role name.
144: */
145: public String getRole() {
146: return role;
147: }
148:
149: /**
150: * The setter method for the role name.
151: *
152: * @param The name of the role to set.
153: */
154: public void setRole(String role) {
155: this .role = role;
156: }
157:
158: /**
159: * The name of the user that this bean will run as.
160: *
161: * @return The string containing the username information.
162: */
163: public String getUsername() {
164: return username;
165: }
166:
167: /**
168: * This method sets the username for the bean.
169: *
170: * @param username The name of the user that the bean will run as.
171: */
172: public void setUsername(String username) {
173: this .username = username;
174: }
175:
176: /**
177: * The getter for the cache results method.
178: *
179: * @return TRUE if set, FALSE if not.
180: */
181: public boolean getCacheResults() {
182: return cacheResults;
183: }
184:
185: /**
186: * The setter method for the cache results object.
187: *
188: * @param cacheResults The value to set the cache results flag to.
189: */
190: public void setCacheResults(boolean cacheResults) {
191: this .cacheResults = cacheResults;
192: }
193:
194: /**
195: * The getter for the cache time out.
196: *
197: * @return A long containing the cache timeout information.
198: */
199: public long getCacheTimeout() {
200: return cacheTimeout;
201: }
202:
203: /**
204: * The setter method for the cache time out.
205: *
206: * @param cacheResults The value to set the cache results flag to.
207: */
208: public void setCacheTimeout(long cacheTimeout) {
209: this .cacheTimeout = cacheTimeout;
210: }
211:
212: /**
213: * The list of threads.
214: *
215: * @return The list of threads for this bean.
216: */
217: public List getThreadInfoList() {
218: return threadInfoList;
219: }
220:
221: /**
222: * This method will add a thread to the list of threads.
223: *
224: * @param threadInfo The thread information to add to the list.
225: */
226: public void addThreadInfo(DeploymentThreadInfo threadInfo) {
227: threadInfoList.add(threadInfo);
228: }
229:
230: /**
231: * This method returns true if the container must control the transaction.
232: *
233: * @return TRUE if it must control the transaction.
234: */
235: public boolean getTransaction() {
236: return transaction;
237: }
238:
239: /**
240: * This method sets the transaction
241: *
242: * @param TRUE if this container must control the transaction.
243: */
244: public void setTransaction(boolean transaction) {
245: this .transaction = transaction;
246: }
247:
248: /**
249: * This method will return true if all the member variables have been
250: * initialized.
251: *
252: * @return TRUE if initialized FALSE if not.
253: */
254: public boolean isInitialized() {
255: if ((interfaceName != null) && (className != null)
256: && (bindName != null) && (role != null)) {
257: return true;
258: }
259: return false;
260: }
261: }
|