1 17 18 19 package org.apache.catalina.ant; 20 21 22 import org.apache.tools.ant.BuildException; 23 24 25 32 public class JMXSetTask extends AbstractCatalinaTask { 33 34 36 39 protected String bean = null; 40 41 44 protected String attribute = null; 45 46 49 protected String value = null; 50 51 53 57 public String getBean () { 58 return this.bean; 59 } 60 61 65 public void setBean (String bean) { 66 this.bean = bean; 67 } 68 69 73 public String getAttribute () { 74 return this.attribute; 75 } 76 77 81 public void setAttribute (String attribute) { 82 this.attribute = attribute; 83 } 84 85 89 public String getValue () { 90 return this.value; 91 } 92 93 97 public void setValue (String value) { 98 this.value = value; 99 } 100 101 106 public void execute() throws BuildException { 107 super.execute(); 108 if (bean == null || attribute == null || value == null) { 109 throw new BuildException 110 ("Must specify 'bean', 'attribute' and 'value' attributes"); 111 } 112 log("Setting attribute " + attribute + 113 " in bean " + bean + 114 " to " + value); 115 execute("/jmxproxy/?set=" + bean 116 + "&att=" + attribute 117 + "&val=" + value); 118 } 119 } 120 | Popular Tags |