KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > service > container > ContainerForm


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer(s): Michel-Ange ANTON
22  * --------------------------------------------------------------------------
23  * $Id: ContainerForm.java,v 1.7 2004/03/19 14:31:49 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas.webapp.jonasadmin.service.container;
28
29 import java.util.ArrayList JavaDoc;
30
31 import javax.servlet.http.HttpServletRequest JavaDoc;
32
33 import org.apache.struts.action.ActionErrors;
34 import org.apache.struts.action.ActionForm;
35 import org.apache.struts.action.ActionMapping;
36 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx;
37
38 public class ContainerForm extends ActionForm {
39
40 // --------------------------------------------------------- Properties variables
41

42     private String JavaDoc path = null;
43     private String JavaDoc filename = null;
44     private String JavaDoc containerName = null;
45     private int currentNumberOfMDBType = 0;
46     private int currentNumberOfSBFType = 0;
47     private int currentNumberOfBMPType = 0;
48     private int currentNumberOfSBLType = 0;
49     private int currentNumberOfCMPType = 0;
50     private int currentNumberOfBeanType = 0;
51     private ArrayList JavaDoc ejbs = new ArrayList JavaDoc();
52     private boolean inEarCase = false;
53     private String JavaDoc earPath = null;
54     private String JavaDoc earFilename = null;
55
56 // --------------------------------------------------------- Public Methods
57

58     /**
59      * Reset all properties to their default values.
60      *
61      * @param mapping The mapping used to select this instance
62      * @param request The servlet request we are processing
63      */

64
65     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
66         containerName = null;
67         currentNumberOfMDBType = 0;
68         currentNumberOfSBFType = 0;
69         currentNumberOfBMPType = 0;
70         currentNumberOfSBLType = 0;
71         currentNumberOfCMPType = 0;
72         currentNumberOfBeanType = 0;
73         inEarCase = false;
74         earPath = null;
75         earFilename = null;
76     }
77
78     /**
79      * Validate the properties that have been set from this HTTP request,
80      * and return an <code>ActionErrors</code> object that encapsulates any
81      * validation errors that have been found. If no errors are found, return
82      * <code>null</code> or an <code>ActionErrors</code> object with no
83      * recorded error messages.
84      *
85      * @param mapping The mapping used to select this instance
86      * @param request The servlet request we are processing
87      */

88     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
89         ActionErrors oErrors = new ActionErrors();
90         return oErrors;
91     }
92
93 // --------------------------------------------------------- Properties Methods
94

95     public String JavaDoc getFilename() {
96         return filename;
97     }
98
99     public String JavaDoc getContainerName() {
100         return containerName;
101     }
102
103     public int getCurrentNumberOfMDBType() {
104         return currentNumberOfMDBType;
105     }
106
107     public int getCurrentNumberOfSBFType() {
108         return currentNumberOfSBFType;
109     }
110
111     public int getCurrentNumberOfBMPType() {
112         return currentNumberOfBMPType;
113     }
114
115     public int getCurrentNumberOfSBLType() {
116         return currentNumberOfSBLType;
117     }
118
119     public int getCurrentNumberOfCMPType() {
120         return currentNumberOfCMPType;
121     }
122
123     public int getCurrentNumberOfBeanType() {
124         return currentNumberOfBeanType;
125     }
126
127     public void setFilename(String JavaDoc filename) {
128         this.filename = filename;
129     }
130
131     public void setContainerName(String JavaDoc containerName) {
132         this.containerName = containerName;
133     }
134
135     public void setCurrentNumberOfMDBType(int currentNumberOfMDBType) {
136         this.currentNumberOfMDBType = currentNumberOfMDBType;
137     }
138
139     public void setCurrentNumberOfSBFType(int currentNumberOfSBFType) {
140         this.currentNumberOfSBFType = currentNumberOfSBFType;
141     }
142
143     public void setCurrentNumberOfBMPType(int currentNumberOfBMPType) {
144         this.currentNumberOfBMPType = currentNumberOfBMPType;
145     }
146
147     public void setCurrentNumberOfSBLType(int currentNumberOfSBLType) {
148         this.currentNumberOfSBLType = currentNumberOfSBLType;
149     }
150
151     public void setCurrentNumberOfCMPType(int currentNumberOfCMPType) {
152         this.currentNumberOfCMPType = currentNumberOfCMPType;
153     }
154
155     public void setCurrentNumberOfBeanType(int currentNumberOfBeanType) {
156         this.currentNumberOfBeanType = currentNumberOfBeanType;
157     }
158
159     public ArrayList JavaDoc getEjbs() {
160         return ejbs;
161     }
162
163     public void setEjbs(ArrayList JavaDoc ejbs) {
164         this.ejbs = ejbs;
165     }
166
167     public String JavaDoc getPath() {
168         return path;
169     }
170
171     public void setPath(String JavaDoc path) {
172         this.path = path;
173     }
174
175     public boolean isInEarCase() {
176         return inEarCase;
177     }
178
179     public void setInEarCase(boolean inEarCase) {
180         this.inEarCase = inEarCase;
181     }
182
183     public String JavaDoc getEarPath() {
184         return earPath;
185     }
186
187     public void setEarPath(String JavaDoc p_EarPath) {
188         earPath = null;
189         earFilename = null;
190         if (p_EarPath != null) {
191             earPath = p_EarPath;
192             earFilename = JonasAdminJmx.extractFilename(earPath);
193         }
194     }
195
196     public String JavaDoc getEarFilename() {
197         return earFilename;
198     }
199
200 }
Popular Tags