1 17 18 19 package org.apache.catalina.ant; 20 21 22 import org.apache.tools.ant.BuildException; 23 24 25 32 public class JMXGetTask extends AbstractCatalinaTask { 33 34 36 39 protected String bean = null; 40 41 44 protected String attribute = null; 45 46 48 52 public String getBean () { 53 return this.bean; 54 } 55 56 60 public void setBean (String bean) { 61 this.bean = bean; 62 } 63 64 68 public String getAttribute () { 69 return this.attribute; 70 } 71 72 76 public void setAttribute (String attribute) { 77 this.attribute = attribute; 78 } 79 80 85 public void execute() throws BuildException { 86 super.execute(); 87 if (bean == null || attribute == null) { 88 throw new BuildException 89 ("Must specify 'bean' and 'attribute' attributes"); 90 } 91 log("Getting attribute " + attribute + 92 " in bean " + bean ); 93 execute("/jmxproxy/?get=" + bean 94 + "&att=" + attribute ); 95 } 96 } 97 | Popular Tags |