KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > jmx > browser > web > taglib > MBeanParameterClassTag


1 /*
2
3  * EJTools, the Enterprise Java Tools
4
5  *
6
7  * Distributable under LGPL license.
8
9  * See terms of license at www.gnu.org.
10
11  */

12
13 package org.ejtools.jmx.browser.web.taglib;
14
15
16
17 import javax.management.MBeanParameterInfo JavaDoc;
18
19 import javax.servlet.jsp.JspException JavaDoc;
20
21 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
22
23
24
25 import org.apache.struts.util.RequestUtils;
26
27 import org.apache.struts.util.ResponseUtils;
28
29 import org.ejtools.util.ClassTools;
30
31
32
33 /**
34
35  * Description of the Class
36
37  *
38
39  * @author letiemble
40
41  * @created 25 avril 2002
42
43  * @version $Revision: 1.6 $
44
45  * @todo Javadoc to complete
46
47  * @jsp:tag name="mbeanParameterClass" body-content="empty"
48
49  */

50
51 public class MBeanParameterClassTag extends TagSupport JavaDoc
52
53 {
54
55    /** Filter the rendered output for characters that are sensitive in HTML? */
56
57    protected boolean filter = true;
58
59    /** Should we ignore missing beans and simply output nothing? */
60
61    protected boolean ignore = false;
62
63    /** Name of the bean that contains the data we will be rendering. */
64
65    protected String JavaDoc name = null;
66
67    /** The scope to be searched to retrieve the specified bean. */
68
69    protected String JavaDoc scope = null;
70
71
72
73
74
75    /**
76
77     * Description of the Method
78
79     *
80
81     * @return Description of the Returned Value
82
83     * @exception JspException Description of the Exception
84
85     */

86
87    public int doStartTag()
88
89       throws JspException JavaDoc
90
91    {
92
93       // Look up the requested bean (if necessary)
94

95       MBeanParameterInfo JavaDoc info = (MBeanParameterInfo JavaDoc) RequestUtils.lookup(pageContext, name, scope);
96
97       if (ignore)
98
99       {
100
101          if (info == null)
102
103          {
104
105             return (SKIP_BODY);
106
107          }
108
109          // Nothing to output
110

111       }
112
113
114
115       String JavaDoc output = ClassTools.classDisplay(info.getType());
116
117
118
119       if (filter)
120
121       {
122
123          ResponseUtils.write(pageContext, ResponseUtils.filter(output));
124
125       }
126
127       else
128
129       {
130
131          ResponseUtils.write(pageContext, output);
132
133       }
134
135
136
137       // Continue processing this page
138

139       return (SKIP_BODY);
140
141    }
142
143
144
145
146
147    /**
148
149     * Getter for the filter attribute
150
151     *
152
153     * @return The value of filter attribute
154
155     * @jsp:attribute name="filter" required="false" rtexprvalue="true"
156
157     */

158
159    public boolean getFilter()
160
161    {
162
163       return (this.filter);
164
165    }
166
167
168
169
170
171    /**
172
173     * Getter for the ignore attribute
174
175     *
176
177     * @return The value of ignore attribute
178
179     * @jsp:attribute name="ignore" required="false" rtexprvalue="true"
180
181     */

182
183    public boolean getIgnore()
184
185    {
186
187       return (this.ignore);
188
189    }
190
191
192
193
194
195    /**
196
197     * Getter for the name attribute
198
199     *
200
201     * @return The value of name attribute
202
203     * @jsp:attribute name="name" required="true" rtexprvalue="true"
204
205     */

206
207    public String JavaDoc getName()
208
209    {
210
211       return (this.name);
212
213    }
214
215
216
217
218
219    /**
220
221     * Getter for the scope attribute
222
223     *
224
225     * @return The value of scope attribute
226
227     * @jsp:attribute name="scope" required="false" rtexprvalue="true"
228
229     */

230
231    public String JavaDoc getScope()
232
233    {
234
235       return (this.scope);
236
237    }
238
239
240
241
242
243    /** Release all allocated resources. */
244
245    public void release()
246
247    {
248
249       super.release();
250
251       filter = true;
252
253       ignore = false;
254
255       name = null;
256
257       scope = null;
258
259    }
260
261
262
263
264
265    /**
266
267     * Setter for the filter attribute
268
269     *
270
271     * @param filter The new filter value
272
273     */

274
275    public void setFilter(boolean filter)
276
277    {
278
279       this.filter = filter;
280
281    }
282
283
284
285
286
287    /**
288
289     * Setter for the ignore attribute
290
291     *
292
293     * @param ignore The new ignore value
294
295     */

296
297    public void setIgnore(boolean ignore)
298
299    {
300
301       this.ignore = ignore;
302
303    }
304
305
306
307
308
309    /**
310
311     * Setter for the name attribute
312
313     *
314
315     * @param name The new name value
316
317     */

318
319    public void setName(String JavaDoc name)
320
321    {
322
323       this.name = name;
324
325    }
326
327
328
329
330
331    /**
332
333     * Setter for the scope attribute
334
335     *
336
337     * @param scope The new scope value
338
339     */

340
341    public void setScope(String JavaDoc scope)
342
343    {
344
345       this.scope = scope;
346
347    }
348
349 }
350
351
352
353
Popular Tags