Home » apache-tomcat-6.0.26-src » org.apache » catalina » ant » jmx » [javadoc | source]
public class: JMXAccessorCondition [javadoc | source]

All Implemented Interfaces:
    Condition, Cloneable

  <path id="catalina_ant">
      <fileset dir="${catalina.home}/server/lib">
          <include name="catalina-ant.jar"/>

Usage: Wait for start backup node
    <target name="wait">
              host="${jmx.host}" port="${jmx.port}" username="${jmx.username}" password="${jmx.password}" />
       <waitfor maxwait="${maxwait}" maxwaitunit="second" timeoutproperty="server.timeout" >
              <socket server="${server.name}" port="${server.port}"/>
              <http url="${url}"/>
                  attribute="connected" value="true"
                  attribute="startupTime" value="250"
      <fail if="server.timeout" message="Server ${url} don't answer inside ${maxwait} sec" />
      <echo message="Server ${url} alive" />

Allowed operation between jmx attribute and reference value: NOTE: For numeric expressions the type must be set and use xml entities as operations.
As type we currently support long and double.
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Method from org.apache.catalina.ant.jmx.JMXAccessorCondition Summary:
accessJMXValue,   eval,   getAttribute,   getHost,   getIf,   getInfo,   getJMXConnection,   getName,   getOperation,   getPassword,   getPort,   getRef,   getType,   getUnless,   getUrl,   getUsername,   getValue,   setAttribute,   setHost,   setIf,   setName,   setOperation,   setPassword,   setPort,   setRef,   setType,   setUnless,   setUrl,   setUsername,   setValue,   testIfCondition,   testUnlessCondition
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.ant.jmx.JMXAccessorCondition Detail:
 protected String accessJMXValue() 
    Get value from MBeans attribute
 public boolean eval() 
    This method evaluates the condition It support for operation ">,>=,<,<=" the types long and double.
 public String getAttribute() 
 public String getHost() 
 public String getIf() 
 public String getInfo() 
    Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.
 protected MBeanServerConnection getJMXConnection() throws MalformedURLException, IOException 
    Get JMXConnection (default look at jmx.server project reference from jmxOpen Task)
 public String getName() 
 public String getOperation() 
 public String getPassword() 
 public String getPort() 
 public String getRef() 
 public String getType() 
 public String getUnless() 
 public String getUrl() 
 public String getUsername() 
 public String getValue() 
 public  void setAttribute(String attribute) 
 public  void setHost(String host) 
 public  void setIf(String c) 
    Only execute if a property of the given name exists in the current project.
 public  void setName(String objectName) 
 public  void setOperation(String operation) 
 public  void setPassword(String password) 
 public  void setPort(String port) 
 public  void setRef(String refId) 
 public  void setType(String type) 
 public  void setUnless(String c) 
    Only execute if a property of the given name does not exist in the current project.
 public  void setUrl(String url) 
 public  void setUsername(String username) 
 public  void setValue(String value) 
 protected boolean testIfCondition() 
    test the if condition
 protected boolean testUnlessCondition() 
    test the unless condition