|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.catalina.ant.jmx.JMXAccessorCondition
public class JMXAccessorCondition
Definition:
<path id="catalina_ant"> <fileset dir="${catalina.home}/server/lib"> <include name="catalina-ant.jar"/> </fileset> </path> <typedef name="jmxCondition" classname="org.apache.catalina.ant.jmx.JMXAccessorCondition" classpathref="catalina_ant"/> <taskdef name="jmxOpen" classname="org.apache.catalina.ant.jmx.JMXAccessorTask" classpathref="catalina_ant"/>Usage: Wait for start backup node
<target name="wait"> <jmxOpen host="${jmx.host}" port="${jmx.port}" username="${jmx.username}" password="${jmx.password}" /> <waitfor maxwait="${maxwait}" maxwaitunit="second" timeoutproperty="server.timeout" > <and> <socket server="${server.name}" port="${server.port}"/> <http url="${url}"/> <jmxCondition name="Catalina:type=IDataSender,host=localhost,senderAddress=192.168.111.1,senderPort=9025" operation="==" attribute="connected" value="true" /> <jmxCondition operation="<" name="Catalina:j2eeType=WebModule,name=//${tomcat.application.host}${tomcat.application.path},J2EEApplication=none,J2EEServer=none" attribute="startupTime" value="250" /> </and> </waitfor> <fail if="server.timeout" message="Server ${url} don't answer inside ${maxwait} sec" /> <echo message="Server ${url} alive" /> </target>Allowed operation between jmx attribute and reference value:
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
JMXAccessorCondition()
|
Method Summary | |
---|---|
protected String |
accessJMXValue()
Get value from MBeans attribute |
boolean |
eval()
This method evaluates the condition It support for operation ">,>=,<,<=" the types long and double . |
String |
getAttribute()
|
String |
getHost()
|
String |
getIf()
|
String |
getInfo()
Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version> . |
protected MBeanServerConnection |
getJMXConnection()
Get JMXConnection (default look at jmx.server project reference from jmxOpen Task) |
String |
getName()
|
String |
getOperation()
|
String |
getPassword()
|
String |
getPort()
|
String |
getRef()
|
String |
getType()
|
String |
getUnless()
|
String |
getUrl()
|
String |
getUsername()
|
String |
getValue()
|
void |
setAttribute(String attribute)
|
void |
setHost(String host)
|
void |
setIf(String c)
Only execute if a property of the given name exists in the current project. |
void |
setName(String objectName)
|
void |
setOperation(String operation)
|
void |
setPassword(String password)
|
void |
setPort(String port)
|
void |
setRef(String refId)
|
void |
setType(String type)
|
void |
setUnless(String c)
Only execute if a property of the given name does not exist in the current project. |
void |
setUrl(String url)
|
void |
setUsername(String username)
|
void |
setValue(String value)
|
protected boolean |
testIfCondition()
test the if condition |
protected boolean |
testUnlessCondition()
test the unless condition |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JMXAccessorCondition()
Method Detail |
---|
public String getInfo()
<description>/<version>
.
public String getOperation()
public void setOperation(String operation)
operation
- The operation to set.public String getType()
public void setType(String type)
type
- The type to set.public String getAttribute()
public void setAttribute(String attribute)
attribute
- The attribute to set.public String getHost()
public void setHost(String host)
host
- The host to set.public String getName()
public void setName(String objectName)
objectName
- The name to set.public String getPassword()
public void setPassword(String password)
password
- The password to set.public String getPort()
public void setPort(String port)
port
- The port to set.public String getUrl()
public void setUrl(String url)
url
- The url to set.public String getUsername()
public void setUsername(String username)
username
- The username to set.public String getValue()
public void setValue(String value)
public String getRef()
public void setRef(String refId)
refId
- The ref to set.public String getIf()
public void setIf(String c)
c
- property namepublic String getUnless()
public void setUnless(String c)
c
- property nameprotected MBeanServerConnection getJMXConnection() throws MalformedURLException, IOException
MalformedURLException
IOException
protected String accessJMXValue()
protected boolean testIfCondition()
protected boolean testUnlessCondition()
public boolean eval()
long
and double
.
eval
in interface org.apache.tools.ant.taskdefs.condition.Condition
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |