org.apache.catalina.ant.jmx
Class JMXAccessorEqualsCondition
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition
- All Implemented Interfaces:
- Cloneable, org.apache.tools.ant.taskdefs.condition.Condition
public class JMXAccessorEqualsCondition
- extends org.apache.tools.ant.ProjectComponent
- implements org.apache.tools.ant.taskdefs.condition.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:
- $Id: JMXAccessorEqualsCondition.java 1058260 2011-01-12 18:13:47Z markt $
- Author:
- Peter Rossbach
Fields inherited from class org.apache.tools.ant.ProjectComponent |
description, location, project |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject |
JMXAccessorEqualsCondition
public JMXAccessorEqualsCondition()
getInfo
public String getInfo()
- Return descriptive information about this implementation and the
corresponding version number, in the format
<description>/<version>
.
getAttribute
public String getAttribute()
- Returns:
- Returns the attribute.
setAttribute
public void setAttribute(String attribute)
- Parameters:
attribute
- The attribute to set.
getHost
public String getHost()
- Returns:
- Returns the host.
setHost
public void setHost(String host)
- Parameters:
host
- The host to set.
getName
public String getName()
- Returns:
- Returns the name.
setName
public void setName(String objectName)
- Parameters:
objectName
- The name to set.
getPassword
public String getPassword()
- Returns:
- Returns the password.
setPassword
public void setPassword(String password)
- Parameters:
password
- The password to set.
getPort
public String getPort()
- Returns:
- Returns the port.
setPort
public void setPort(String port)
- Parameters:
port
- The port to set.
getUrl
public String getUrl()
- Returns:
- Returns the url.
setUrl
public void setUrl(String url)
- Parameters:
url
- The url to set.
getUsername
public String getUsername()
- Returns:
- Returns the username.
setUsername
public void setUsername(String username)
- Parameters:
username
- The username to set.
getValue
public String getValue()
- Returns:
- Returns the value.
setValue
public void setValue(String value)
getRef
public String getRef()
- Returns:
- Returns the ref.
setRef
public void setRef(String refId)
- Parameters:
refId
- The ref to set.
getJMXConnection
protected MBeanServerConnection getJMXConnection()
throws MalformedURLException,
IOException
- Throws:
MalformedURLException
IOException
accessJMXValue
protected String accessJMXValue()
- Returns:
- The value
eval
public boolean eval()
- Specified by:
eval
in interface org.apache.tools.ant.taskdefs.condition.Condition
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.