1 12 13 package org.ejtools.jmx.browser.web.taglib; 14 15 16 17 import javax.management.MBeanParameterInfo ; 18 19 import javax.servlet.jsp.JspException ; 20 21 import javax.servlet.jsp.tagext.TagSupport ; 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 50 51 public class MBeanParameterClassTag extends TagSupport 52 53 { 54 55 56 57 protected boolean filter = true; 58 59 60 61 protected boolean ignore = false; 62 63 64 65 protected String name = null; 66 67 68 69 protected String scope = null; 70 71 72 73 74 75 86 87 public int doStartTag() 88 89 throws JspException 90 91 { 92 93 95 MBeanParameterInfo info = (MBeanParameterInfo ) 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 111 } 112 113 114 115 String 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 139 return (SKIP_BODY); 140 141 } 142 143 144 145 146 147 158 159 public boolean getFilter() 160 161 { 162 163 return (this.filter); 164 165 } 166 167 168 169 170 171 182 183 public boolean getIgnore() 184 185 { 186 187 return (this.ignore); 188 189 } 190 191 192 193 194 195 206 207 public String getName() 208 209 { 210 211 return (this.name); 212 213 } 214 215 216 217 218 219 230 231 public String getScope() 232 233 { 234 235 return (this.scope); 236 237 } 238 239 240 241 242 243 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 274 275 public void setFilter(boolean filter) 276 277 { 278 279 this.filter = filter; 280 281 } 282 283 284 285 286 287 296 297 public void setIgnore(boolean ignore) 298 299 { 300 301 this.ignore = ignore; 302 303 } 304 305 306 307 308 309 318 319 public void setName(String name) 320 321 { 322 323 this.name = name; 324 325 } 326 327 328 329 330 331 340 341 public void setScope(String scope) 342 343 { 344 345 this.scope = scope; 346 347 } 348 349 } 350 351 352 353 | Popular Tags |