KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > webjmx > tags > FindServerTag


1 /*
2  * Copyright (C) WebJMX.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the WebJMX License version 2.0.
6  * See the terms of the WebJMX License in the documentation provided with this software.
7  */

8 /*
9  * FindServerTag.java
10  *
11  * Created on October 24, 2001, 11:10 AM
12  */

13
14 package org.webjmx.tags;
15
16 import java.util.*;
17 import javax.management.*;
18 import javax.servlet.jsp.*;
19 import javax.servlet.jsp.tagext.*;
20
21 import org.webjmx.adapter.*;
22
23 /** This tag put a List of MBeanServer instances in the page context under the given ID.
24  * CALL -> AdapterFactory.findMBeanServer(locator)
25  *
26  * @author John Aronson
27  */

28 public class FindServerTag extends TagSupport
29     implements ILocatorTag, JMXTaglibConstants
30 {
31     
32     /** Holds value of property id. Name of the pageContext attribute to be added. */
33     private String JavaDoc id;
34     
35     /** Holds value of property locator. Search parameter for the finMBeanServer call. */
36     private String JavaDoc locator;
37
38     /** Process the start tag for this instance.
39      * @throws JspException
40      * @return
41      */

42     public int doStartTag()
43         throws JspException
44     {
45         return (EVAL_BODY_INCLUDE);
46     }
47
48     /** Process the end tag for this instance.
49      * @throws JspException
50      * @return
51      */

52     public int doEndTag()
53         throws JspException
54     {
55         //if(attribute != null && locator == null)
56
// locator = pageContext.getAttribute(attribute).toString();
57

58         List l = AdapterFactory.findMBeanServer(locator);
59         pageContext.setAttribute(id, l);
60         
61         return (EVAL_PAGE);
62     }
63        
64     /** Getter for property id.
65      * @return Value of property id.
66      */

67     public String JavaDoc getId()
68     {
69         return id;
70     }
71     
72     /** Setter for property id.
73      * @param id New value of property id.
74      */

75     public void setId(String JavaDoc id)
76     {
77         this.id = id;
78     }
79     
80     /** Getter for property locator.
81      * @return Value of property locator.
82      */

83     public String JavaDoc getLocator()
84     {
85         return locator;
86     }
87     
88     /** Setter for property locator.
89      * @param locator New value of property locator.
90      */

91     public void setLocator(String JavaDoc locator)
92     {
93         this.locator = locator;
94     }
95     
96     /** Called on a Tag handler to release state
97      *
98      */

99     public void release()
100     {
101         locator = id = null;
102     }
103 }
104
Popular Tags