Method from org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition Detail: |
protected String accessJMXValue() {
try {
Object result = getJMXConnection().getAttribute(
new ObjectName(name), attribute);
if(result != null)
return result.toString();
} catch (Exception e) {
// ignore access or connection open errors
}
return null;
}
|
public boolean eval() {
if (value == null) {
throw new BuildException("value attribute is not set");
}
if ((name == null || attribute == null)) {
throw new BuildException(
"Must specify a 'attribute', name for equals condition");
}
//FIXME check url or host/parameter
String jmxValue = accessJMXValue();
if(jmxValue != null)
return jmxValue.equals(value);
return false;
}
|
public String getAttribute() {
return attribute;
}
|
public String getHost() {
return host;
}
|
public String getInfo() {
return (info);
}
Return descriptive information about this implementation and the
corresponding version number, in the format
<description>/<version> . |
protected MBeanServerConnection getJMXConnection() throws MalformedURLException, IOException {
return JMXAccessorTask.accessJMXConnection(
getProject(),
getUrl(), getHost(),
getPort(), getUsername(), getPassword(), ref);
}
|
public String getName() {
return name;
}
|
public String getPassword() {
return password;
}
|
public String getPort() {
return port;
}
|
public String getRef() {
return ref;
}
|
public String getUrl() {
return url;
}
|
public String getUsername() {
return username;
}
|
public String getValue() {
return value;
}
|
public void setAttribute(String attribute) {
this.attribute = attribute;
}
|
public void setHost(String host) {
this.host = host;
}
|
public void setName(String objectName) {
this.name = objectName;
}
|
public void setPassword(String password) {
this.password = password;
}
|
public void setPort(String port) {
this.port = port;
}
|
public void setRef(String refId) {
this.ref = refId;
}
|
public void setUrl(String url) {
this.url = url;
}
|
public void setUsername(String username) {
this.username = username;
}
|
public void setValue(String value) {
this.value = value;
}
|