org.apache.catalina.ant.jmx

Class JMXAccessorEqualsCondition

public class JMXAccessorEqualsCondition extends ProjectComponent implements Condition

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

   <typedef
       name="jmxEquals"
       classname="org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition"
       classpathref="catalina_ant"/>
 
usage: Wait for start backup node
     <target name="wait">
        <waitfor maxwait="${maxwait}" maxwaitunit="second" timeoutproperty="server.timeout" >
           <and>
               <socket server="${server.name}" port="${server.port}"/>
               <http url="${url}"/>
               <jmxEquals 
                   host="localhost" port="9014" username="controlRole" password="tomcat"
                   name="Catalina:type=IDataSender,host=localhost,senderAddress=192.168.111.1,senderPort=9025"
                   attribute="connected" value="true"
               />
           </and>
       </waitfor>
       <fail if="server.timeout" message="Server ${url} don't answer inside ${maxwait} sec" />
       <echo message="Server ${url} alive" />
   </target>

 

Since: 5.5.10

Version: $Revision: 612599 $ $Date: 2008-01-16 23:37:36 +0100 (Wed, 16 Jan 2008) $

Author: Peter Rossbach

Method Summary
protected StringaccessJMXValue()
booleaneval()
StringgetAttribute()
StringgetHost()
StringgetInfo()
Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.
protected MBeanServerConnectiongetJMXConnection()
StringgetName()
StringgetPassword()
StringgetPort()
StringgetRef()
StringgetUrl()
StringgetUsername()
StringgetValue()
voidsetAttribute(String attribute)
voidsetHost(String host)
voidsetName(String objectName)
voidsetPassword(String password)
voidsetPort(String port)
voidsetRef(String refId)
voidsetUrl(String url)
voidsetUsername(String username)
voidsetValue(String value)

Method Detail

accessJMXValue

protected String accessJMXValue()

Returns: The value

eval

public boolean eval()

getAttribute

public String getAttribute()

Returns: Returns the attribute.

getHost

public String getHost()

Returns: Returns the host.

getInfo

public String getInfo()
Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.

getJMXConnection

protected MBeanServerConnection getJMXConnection()

getName

public String getName()

Returns: Returns the name.

getPassword

public String getPassword()

Returns: Returns the password.

getPort

public String getPort()

Returns: Returns the port.

getRef

public String getRef()

Returns: Returns the ref.

getUrl

public String getUrl()

Returns: Returns the url.

getUsername

public String getUsername()

Returns: Returns the username.

getValue

public String getValue()

Returns: Returns the value.

setAttribute

public void setAttribute(String attribute)

Parameters: attribute The attribute to set.

setHost

public void setHost(String host)

Parameters: host The host to set.

setName

public void setName(String objectName)

Parameters: objectName The name to set.

setPassword

public void setPassword(String password)

Parameters: password The password to set.

setPort

public void setPort(String port)

Parameters: port The port to set.

setRef

public void setRef(String refId)

Parameters: refId The ref to set.

setUrl

public void setUrl(String url)

Parameters: url The url to set.

setUsername

public void setUsername(String username)

Parameters: username The username to set.

setValue

public void setValue(String value)
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.