KickJava   Java API By Example, From Geeks To Geeks.

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


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  * DeploymentThreadInfo.java
22  *
23  * This class contains the thread information for either for a bean or jmx bean
24  * deployment.
25  */

26
27 // the package path
28
package com.rift.coad.lib.deployment;
29
30 /**
31  * This class contains the thread information for either for a bean or jmx bean
32  * deployment.
33  *
34  * @author Brett Chaldecott
35  */

36 public class DeploymentThreadInfo {
37     
38     // the deployment information
39
private String JavaDoc className = "";
40     private String JavaDoc username = "";
41     private long threadNumber = 0;
42     
43     /**
44      * Creates a new instance of DeploymentThreadInfo
45      */

46     public DeploymentThreadInfo() {
47     }
48     
49     
50     /**
51      * This method returns the name of the thread class.
52      *
53      * @return The string containing the class name of the thread to run.
54      */

55     public String JavaDoc getClassName() {
56         return className;
57     }
58     
59     
60     /**
61      * This method sets the name of the thread class.
62      *
63      * @param className The name of the class to run.
64      */

65     public void setClassName(String JavaDoc className) {
66         this.className = className;
67     }
68     
69     
70     /**
71      * This method returns the name of the user.
72      *
73      * @return The string containing the user name.
74      */

75     public String JavaDoc getUsername() {
76         return username;
77     }
78     
79     
80     /**
81      * This method set the name of the user that the threads will run as.
82      *
83      * @param username;
84      */

85     public void setUsername(String JavaDoc username) {
86         this.username = username;
87     }
88     
89     
90     /**
91      * This method returns the number of threads that will be started.
92      *
93      * @return The number of threads to start.
94      */

95     public long getThreadNumber() {
96         return threadNumber;
97     }
98     
99     
100     /**
101      * Sets the number of threads to run
102      *
103      * @param threadNumber The number of threads to start.
104      */

105     public void setThreadNumber(long threadNumber) {
106         this.threadNumber = threadNumber;
107     }
108     
109     
110     /**
111      * This method returns false if this object is not initialized correctly and
112      * true if it is.
113      *
114      * @return TRUE if initialized correctly and FALSE if not.
115      */

116     public boolean isInitialized() {
117         if ((className == null) || (threadNumber == 0)) {
118             return false;
119         }
120         return true;
121     }
122 }
123
Popular Tags