| Hongqing Liu | 7189829 | 2014-10-15 13:31:32 +0800 | [diff] [blame] | 1 | <html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat 6.0 (6.0.41) - Monitoring and Managing Tomcat</title><style type="text/css" media="print">
 | 
| Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 2 | 			.noPrint {display: none;}
 | 
 | 3 | 			td#mainBody {width: 100%;}
 | 
 | 4 | 		</style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="./images/tomcat.gif" align="right" alt="
 | 
 | 5 |       The Apache Tomcat Servlet/JSP Container
 | 
| Hongqing Liu | 7189829 | 2014-10-15 13:31:32 +0800 | [diff] [blame] | 6 |     " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 6.0</font></h1><font face="arial,helvetica,sanserif">Version 6.0.41, May 19 2014</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="./images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap="nowrap" class="noPrint"><p><strong>Links</strong></p><ul><li><a href="index.html">Docs Home</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li></ul><p><strong>User Guide</strong></p><ul><li><a href="introduction.html">1) Introduction</a></li><li><a href="setup.html">2) Setup</a></li><li><a href="appdev/index.html">3) First webapp</a></li><li><a href="deployer-howto.html">4) Deployer</a></li><li><a href="manager-howto.html">5) Manager</a></li><li><a href="realm-howto.html">6) Realms and AAA</a></li><li><a href="security-manager-howto.html">7) Security Manager</a></li><li><a href="jndi-resources-howto.html">8) JNDI Resources</a></li><li><a href="jndi-datasource-examples-howto.html">9) JDBC DataSources</a></li><li><a href="class-loader-howto.html">10) Classloading</a></li><li><a href="jasper-howto.html">11) JSPs</a></li><li><a href="ssl-howto.html">12) SSL</a></li><li><a href="ssi-howto.html">13) SSI</a></li><li><a href="cgi-howto.html">14) CGI</a></li><li><a href="proxy-howto.html">15) Proxy Support</a></li><li><a href="mbeans-descriptor-howto.html">16) MBean Descriptor</a></li><li><a href="default-servlet.html">17) Default Servlet</a></li><li><a href="cluster-howto.html">18) Clustering</a></li><li><a href="balancer-howto.html">19) Load Balancer</a></li><li><a href="connectors.html">20) Connectors</a></li><li><a href="monitoring.html">21) Monitoring and Management</a></li><li><a href="logging.html">22) Logging</a></li><li><a href="apr.html">23) APR/Native</a></li><li><a href="virtual-hosting-howto.html">24) Virtual Hosting</a></li><li><a href="aio.html">25) Advanced IO</a></li><li><a href="extras.html">26) Additional Components</a></li><li><a href="maven-jars.html">27) Mavenized</a></li></ul><p><strong>Reference</strong></p><ul><li><a href="RELEASE-NOTES.txt">Release Notes</a></li><li><a href="config/index.html">Configuration</a></li><li><a href="api/index.html">Javadocs</a></li><li><a href="http://tomcat.apache.org/connectors-doc/">JK 1.2 Documentation</a></li></ul><p><strong>Apache Tomcat Development</strong></p><ul><li><a href="building.html">Building</a></li><li><a href="changelog.html">Changelog</a></li><li><a href="http://wiki.apache.org/tomcat/TomcatVersions">Status</a></li><li><a href="developers.html">Developers</a></li><li><a href="architecture/index.html">Architecture</a></li><li><a href="funcspecs/index.html">Functional Specs.</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Apache Tomcat 6.0</h1><h2>Monitoring and Managing Tomcat</h2><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
 | 
| Hongqing Liu | fd5ee81 | 2014-05-10 16:32:51 +0800 | [diff] [blame] | 7 | <ul><li><a href="#Introduction">Introduction</a></li><li><a href="#Enabling_JMX_Remote">Enabling JMX Remote</a></li><li><a href="#Manage_Tomcat_with_JMX_remote_Ant_Tasks">Manage Tomcat with JMX remote Ant Tasks</a></li><li><a href="#JMXAccessorOpenTask_-_JMX_open_connection_task">JMXAccessorOpenTask - JMX open connection task</a></li><li><a href="#JMXAccessorGetTask:__get_attribute_value_Ant_task">JMXAccessorGetTask:  get attribute value Ant task</a></li><li><a href="#JMXAccessorSetTask:__set_attribute_value_Ant_task">JMXAccessorSetTask:  set attribute value Ant task</a></li><li><a href="#JMXAccessorInvokeTask:__invoke_MBean_operation_Ant_task">JMXAccessorInvokeTask:  invoke MBean operation Ant task</a></li><li><a href="#JMXAccessorQueryTask:__query_MBean_Ant_task">JMXAccessorQueryTask:  query MBean Ant task</a></li><li><a href="#JMXAccessorCreateTask:__remote_create_MBean_Ant_task">JMXAccessorCreateTask:  remote create MBean Ant task</a></li><li><a href="#JMXAccessorUnregisterTask:__remote_unregister_MBean_Ant_task">JMXAccessorUnregisterTask:  remote unregister MBean Ant task</a></li><li><a href="#JMXAccessorCondition:__express_condition">JMXAccessorCondition:  express condition</a></li><li><a href="#JMXAccessorEqualsCondition:__equals_MBean_Ant_condition">JMXAccessorEqualsCondition:  equals MBean Ant condition</a></li></ul>
 | 
 | 8 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 9 | 
 | 
 | 10 |   <p>Monitoring is a key aspect of system administration. Looking inside a
 | 
 | 11 |      running server, obtaining some statistics or reconfiguring some aspects of
 | 
 | 12 |      an application are all daily administration tasks.</p>  
 | 
 | 13 |   
 | 
 | 14 |   </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Enabling JMX Remote"><!--()--></a><a name="Enabling_JMX_Remote"><strong>Enabling JMX Remote</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 15 | 
 | 
 | 16 |     <p><strong>Note:</strong> This configuration is needed if you are
 | 
 | 17 |     going to monitor Tomcat remotely. If you are going
 | 
 | 18 |     to monitor it locally, using the same user that Tomcat runs with, then
 | 
 | 19 |     with Java 6 it is not needed at all, and with Java 5 it is as simple as
 | 
 | 20 |     adding <code>-Dcom.sun.management.jmxremote</code>, see Java documentation.</p>
 | 
 | 21 | 
 | 
 | 22 |     <p>The Oracle website includes the list of options and how to configure JMX Remote on Java 5:
 | 
 | 23 |         <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html">
 | 
 | 24 |         http://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html</a>
 | 
 | 25 |         and on Java 6:
 | 
 | 26 |         <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/management/agent.html">
 | 
 | 27 |         http://docs.oracle.com/javase/6/docs/technotes/guides/management/agent.html</a>.
 | 
 | 28 |     </p>
 | 
 | 29 |     <p>The following is a quick configuration guide for Java 5:</p>
 | 
 | 30 |     <p>Add the following parameters to <code>setenv.bat</code> script of your
 | 
 | 31 |     Tomcat (see <a href="RUNNING.txt">RUNNING.txt</a> for details).<br>
 | 
 | 32 |     <em>Note:</em> This syntax is for Microsoft Windows. The command has
 | 
 | 33 |     to be on the same line. It is wrapped to be more readable. If Tomcat is
 | 
 | 34 |     running as a Windows service, use its configuration dialog to set
 | 
 | 35 |     java options for the service.
 | 
 | 36 |     For un*xes remove <code>"set "</code> from beginning of the line.
 | 
 | 37 |     </p>
 | 
 | 38 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 39 | set CATALINA_OPTS=-Dcom.sun.management.jmxremote
 | 
 | 40 |   -Dcom.sun.management.jmxremote.port=%my.jmx.port%
 | 
 | 41 |   -Dcom.sun.management.jmxremote.ssl=false
 | 
 | 42 |   -Dcom.sun.management.jmxremote.authenticate=false
 | 
 | 43 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 44 | 
 | 
 | 45 |     <ol>
 | 
 | 46 |     <li>If you require authorization, add and change this :
 | 
 | 47 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 48 |   -Dcom.sun.management.jmxremote.authenticate=true
 | 
 | 49 |   -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password
 | 
 | 50 |   -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access
 | 
 | 51 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 52 |     </li>
 | 
 | 53 |     <li>edit the access authorization file <em>$CATALINA_BASE/conf/jmxremote.access</em> :
 | 
 | 54 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 55 | monitorRole readonly
 | 
 | 56 | controlRole readwrite
 | 
 | 57 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 58 |     </li>
 | 
 | 59 |     <li>edit the password file <em>$CATALINA_BASE/conf/jmxremote.password</em> :
 | 
 | 60 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 61 | monitorRole tomcat
 | 
 | 62 | controlRole tomcat
 | 
 | 63 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 64 |     <b>Tip</b>: The password file should be read-only and only accessible by the
 | 
 | 65 |     operating system user Tomcat is running as.
 | 
 | 66 |     </li>
 | 
 | 67 |     </ol>
 | 
 | 68 |     <p><strong>Note:</strong> The JSR 160 JMX-Adaptor opens a second data channel
 | 
 | 69 |     on a random port. That is a problem when you have a local firewall installed.
 | 
 | 70 |     To fix it, configure a <code>JmxRemoteLifecycleListener</code>, as described
 | 
 | 71 |     in <a href="config/listeners.html">listeners</a> documentation.
 | 
 | 72 |     </p>
 | 
 | 73 | 
 | 
 | 74 |   </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Manage Tomcat with JMX remote Ant Tasks"><!--()--></a><a name="Manage_Tomcat_with_JMX_remote_Ant_Tasks"><strong>Manage Tomcat with JMX remote Ant Tasks</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 75 |    <p>To simplify JMX usage with Ant 1.6.x, a set of tasks is provided that may
 | 
 | 76 |    be used with antlib.</p>   
 | 
 | 77 |    <p><b>antlib</b>: Copy your catalina-ant.jar from $CATALINA_HOME/lib to $ANT_HOME/lib.</p>
 | 
 | 78 |    <p>The following example shows the JMX Accessor usage:<br>
 | 
 | 79 |    <em>Note:</em> The <code>name</code> attribute value was wrapped here to be
 | 
 | 80 |    more readable. It has to be all on the same line, without spaces.</p>
 | 
 | 81 |    <table border="1">
 | 
 | 82 |    <tr><td><pre>
 | 
 | 83 | <project name="Catalina Ant JMX"
 | 
 | 84 |       xmlns:jmx="antlib:org.apache.catalina.ant.jmx"
 | 
 | 85 |       default="state"
 | 
 | 86 |       basedir=".">
 | 
 | 87 |   <property name="jmx.server.name" value="localhost" />
 | 
 | 88 |   <property name="jmx.server.port" value="9012" />
 | 
 | 89 |   <property name="cluster.server.address" value="192.168.1.75" />
 | 
 | 90 |   <property name="cluster.server.port" value="9025" />
 | 
 | 91 | 
 | 
 | 92 |   <target name="state" description="Show JMX Cluster state">
 | 
 | 93 |     <jmx:open
 | 
 | 94 |       host="${jmx.server.name}"
 | 
 | 95 |       port="${jmx.server.port}"
 | 
 | 96 |       username="controlRole"
 | 
 | 97 |       password="tomcat"/>
 | 
 | 98 |     <jmx:get
 | 
 | 99 |       name=
 | 
 | 100 | "Catalina:type=IDataSender,host=localhost,
 | 
 | 101 | senderAddress=${cluster.server.address},senderPort=${cluster.server.port}"
 | 
 | 102 |       attribute="connected"
 | 
 | 103 |       resultproperty="IDataSender.backup.connected"
 | 
 | 104 |       echo="false"
 | 
 | 105 |     />
 | 
 | 106 |     <jmx:get
 | 
 | 107 |       name="Catalina:type=ClusterSender,host=localhost"
 | 
 | 108 |       attribute="senderObjectNames"
 | 
 | 109 |       resultproperty="senderObjectNames"
 | 
 | 110 |       echo="false"
 | 
 | 111 |     />
 | 
 | 112 |     <!-- get current maxActiveSession from ClusterTest application
 | 
 | 113 |        echo it to Ant output and store at
 | 
 | 114 |        property <em>clustertest.maxActiveSessions.orginal</em>
 | 
 | 115 |     -->
 | 
 | 116 |     <jmx:get
 | 
 | 117 |       name="Catalina:type=Manager,path=/ClusterTest,host=localhost"
 | 
 | 118 |       attribute="maxActiveSessions"
 | 
 | 119 |       resultproperty="clustertest.maxActiveSessions.orginal"
 | 
 | 120 |       echo="true"
 | 
 | 121 |     />
 | 
 | 122 |     <!-- set maxActiveSession to 100
 | 
 | 123 |     -->
 | 
 | 124 |     <jmx:set
 | 
 | 125 |       name="Catalina:type=Manager,path=/ClusterTest,host=localhost"
 | 
 | 126 |       attribute="maxActiveSessions"
 | 
 | 127 |       value="100"
 | 
 | 128 |       type="int"
 | 
 | 129 |     />
 | 
 | 130 |     <!-- get all sessions and split result as delimiter <em>SPACE</em> for easy
 | 
 | 131 |        access all session ids directly with Ant property sessions.[0..n].
 | 
 | 132 |     -->
 | 
 | 133 |     <jmx:invoke
 | 
 | 134 |       name="Catalina:type=Manager,path=/ClusterTest,host=localhost"
 | 
 | 135 |       operation="listSessionIds"
 | 
 | 136 |       resultproperty="sessions"
 | 
 | 137 |       echo="false"
 | 
 | 138 |       delimiter=" "
 | 
 | 139 |     />
 | 
 | 140 |     <!-- Access session attribute <em>Hello</em> from first session.
 | 
 | 141 |     -->
 | 
 | 142 |     <jmx:invoke
 | 
 | 143 |       name="Catalina:type=Manager,path=/ClusterTest,host=localhost"
 | 
 | 144 |       operation="getSessionAttribute"
 | 
 | 145 |       resultproperty="Hello"
 | 
 | 146 |       echo="false"
 | 
 | 147 |     >
 | 
 | 148 |       <arg value="${sessions.0}"/>
 | 
 | 149 |       <arg value="Hello"/>
 | 
 | 150 |     </jmx:invoke>
 | 
 | 151 |     <!-- Query for all application manager.of the server from all hosts
 | 
 | 152 |        and bind all attributes from all found manager MBeans.
 | 
 | 153 |     -->
 | 
 | 154 |     <jmx:query
 | 
 | 155 |       name="Catalina:type=Manager,*"
 | 
 | 156 |       resultproperty="manager"
 | 
 | 157 |       echo="true"
 | 
 | 158 |       attributebinding="true"
 | 
 | 159 |     />
 | 
 | 160 |     <!-- echo the create properties -->
 | 
 | 161 | <echo>
 | 
 | 162 | senderObjectNames: ${senderObjectNames.0}
 | 
 | 163 | IDataSender.backup.connected: ${IDataSender.backup.connected}
 | 
 | 164 | session: ${sessions.0}
 | 
 | 165 | manager.length: ${manager.length}
 | 
 | 166 | manager.0.name: ${manager.0.name}
 | 
 | 167 | manager.1.name: ${manager.1.name}
 | 
 | 168 | hello: ${Hello}
 | 
 | 169 | manager.ClusterTest.0.name: ${manager.ClusterTest.0.name}
 | 
 | 170 | manager.ClusterTest.0.activeSessions: ${manager.ClusterTest.0.activeSessions}
 | 
 | 171 | manager.ClusterTest.0.counterSend_EVT_SESSION_EXPIRED:
 | 
 | 172 |  ${manager.ClusterTest.0.counterSend_EVT_SESSION_EXPIRED}
 | 
 | 173 | manager.ClusterTest.0.counterSend_EVT_GET_ALL_SESSIONS:
 | 
 | 174 |  ${manager.ClusterTest.0.counterSend_EVT_GET_ALL_SESSIONS}
 | 
 | 175 | </echo>
 | 
 | 176 | 
 | 
 | 177 |   </target>
 | 
 | 178 | 
 | 
 | 179 | </project>
 | 
 | 180 | </pre>
 | 
 | 181 |    </td></tr>
 | 
 | 182 | </table>
 | 
 | 183 |    <p><b>import:</b> Import the JMX Accessor Project with 
 | 
 | 184 |    <em><import file="${CATALINA.HOME}/bin/catalina-tasks.xml" /></em> and
 | 
 | 185 |    reference the tasks with <em>jmxOpen</em>, <em>jmxSet</em>, <em>jmxGet</em>,
 | 
 | 186 |    <em>jmxQuery</em>, <em>jmxInvoke</em>, <em>jmxEquals</em> and <em>jmxCondition</em>.</p>
 | 
 | 187 | 
 | 
 | 188 |   </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorOpenTask - JMX open connection task"><!--()--></a><a name="JMXAccessorOpenTask_-_JMX_open_connection_task"><strong>JMXAccessorOpenTask - JMX open connection task</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 189 | <p>
 | 
 | 190 | List of Attributes<br>
 | 
 | 191 | <table border="1" cellpadding="5">
 | 
 | 192 | 
 | 
 | 193 |   <tr>
 | 
 | 194 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 195 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 196 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 197 |   </tr>
 | 
 | 198 | 
 | 
 | 199 |   <tr>
 | 
 | 200 |     <td>url</td>
 | 
 | 201 |     <td>Set JMX connection URL - <em>service:jmx:rmi:///jndi/rmi://localhost:8050/jmxrmi</em>
 | 
 | 202 |     </td>
 | 
 | 203 |     <td></td>
 | 
 | 204 |   </tr>
 | 
 | 205 | 
 | 
 | 206 |   <tr>
 | 
 | 207 |     <td>host</td>
 | 
 | 208 |     <td>Set the host, shortcut the very long URL syntax.
 | 
 | 209 |     </td>
 | 
 | 210 |     <td><code>localhost</code></td>
 | 
 | 211 |   </tr>
 | 
 | 212 | 
 | 
 | 213 |   <tr>
 | 
 | 214 |     <td>port</td>
 | 
 | 215 |     <td>Set the remote connection port 
 | 
 | 216 |     </td>
 | 
 | 217 |     <td><code>8050</code></td>
 | 
 | 218 |   </tr>
 | 
 | 219 | 
 | 
 | 220 |   <tr>
 | 
 | 221 |     <td>username</td>
 | 
 | 222 |     <td>remote JMX connection user name.
 | 
 | 223 |     </td>
 | 
 | 224 |     <td></td>
 | 
 | 225 |   </tr>
 | 
 | 226 | 
 | 
 | 227 |   <tr>
 | 
 | 228 |     <td>password</td>
 | 
 | 229 |     <td>remote JMX connection password.
 | 
 | 230 |     </td>
 | 
 | 231 |     <td></td>
 | 
 | 232 |   </tr>
 | 
 | 233 | 
 | 
 | 234 |   <tr>
 | 
 | 235 |     <td>ref</td>
 | 
 | 236 |     <td>Name of the internal connection reference. With this attribute you can
 | 
 | 237 |         configure more the one connection inside the same Ant project.
 | 
 | 238 |     </td>
 | 
 | 239 |     <td><code>jmx.server</code></td>
 | 
 | 240 |   </tr>
 | 
 | 241 | 
 | 
 | 242 |   <tr>
 | 
 | 243 |     <td>echo</td>
 | 
 | 244 |     <td>Echo the command usage (for access analysis or debugging)
 | 
 | 245 |     </td>
 | 
 | 246 |     <td><code>false</code></td>
 | 
 | 247 |   </tr>
 | 
 | 248 |   
 | 
 | 249 |   <tr>
 | 
 | 250 |     <td>if</td>
 | 
 | 251 |     <td>Only execute if a property of the given name <b>exists</b> in the current project.
 | 
 | 252 |     </td>
 | 
 | 253 |     <td></td>
 | 
 | 254 |   </tr>
 | 
 | 255 | 
 | 
 | 256 |   <tr>
 | 
 | 257 |     <td>unless</td>
 | 
 | 258 |     <td>Only execute if a property of the given name <b>not exists</b> in the current project.
 | 
 | 259 |     </td>
 | 
 | 260 |     <td></td>
 | 
 | 261 |   </tr>
 | 
 | 262 | 
 | 
 | 263 | </table>
 | 
 | 264 | </p>
 | 
 | 265 | <p>
 | 
 | 266 | Example to open a new JMX connection<br>
 | 
 | 267 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 268 |   <jmx:open
 | 
 | 269 |     host="${jmx.server.name}"
 | 
 | 270 |     port="${jmx.server.port}"
 | 
 | 271 |   />
 | 
 | 272 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 273 | </p>  
 | 
 | 274 | <p>
 | 
 | 275 | Example to open a JMX connection from URL, with authorization and 
 | 
 | 276 | store at other reference <br>
 | 
 | 277 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 278 |   <jmx:open
 | 
 | 279 |     url="service:jmx:rmi:///jndi/rmi://localhost:9024/jmxrmi"
 | 
 | 280 |     ref="jmx.server.9024"
 | 
 | 281 |     username="controlRole"
 | 
 | 282 |     password="tomcat"
 | 
 | 283 |   />
 | 
 | 284 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 285 | </p>  
 | 
 | 286 | 
 | 
 | 287 | <p>
 | 
 | 288 | Example to open a JMX connection from URL, with authorization and 
 | 
 | 289 | store at other reference, but only when property <em>jmx.if</em> exists and 
 | 
 | 290 | <em>jmx.unless</em> not exists<br>
 | 
 | 291 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 292 |   <jmx:open
 | 
 | 293 |     url="service:jmx:rmi:///jndi/rmi://localhost:9024/jmxrmi"
 | 
 | 294 |     ref="jmx.server.9024"
 | 
 | 295 |     username="controlRole"
 | 
 | 296 |     password="tomcat"
 | 
 | 297 |     if="jmx.if"
 | 
 | 298 |     unless="jmx.unless"
 | 
 | 299 |   />
 | 
 | 300 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 301 | </p> 
 | 
 | 302 | <p><b>Note</b>: All properties from <em>jmxOpen</em> task also exists at all 
 | 
 | 303 | other tasks and conditions. 
 | 
 | 304 | </p>
 | 
 | 305 | 
 | 
 | 306 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorGetTask:  get attribute value Ant task"><!--()--></a><a name="JMXAccessorGetTask:__get_attribute_value_Ant_task"><strong>JMXAccessorGetTask:  get attribute value Ant task</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 307 | <p>
 | 
 | 308 | List of Attributes<br>
 | 
 | 309 | <table border="1" cellpadding="5">
 | 
 | 310 | 
 | 
 | 311 |   <tr>
 | 
 | 312 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 313 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 314 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 315 |   </tr>
 | 
 | 316 | 
 | 
 | 317 |   <tr>
 | 
 | 318 |     <td>name</td>
 | 
 | 319 |     <td>Full qualified JMX ObjectName -- <em>Catalina:type=Server</em>
 | 
 | 320 |     </td>
 | 
 | 321 |     <td></td>
 | 
 | 322 |   </tr>
 | 
 | 323 | 
 | 
 | 324 |   <tr>
 | 
 | 325 |     <td>attribute</td>
 | 
 | 326 |     <td>Existing MBean attribute (see Tomcat MBean description above)
 | 
 | 327 |     </td>
 | 
 | 328 |     <td></td>
 | 
 | 329 |   </tr>
 | 
 | 330 | 
 | 
 | 331 |   <tr>
 | 
 | 332 |     <td>ref</td>
 | 
 | 333 |     <td>JMX Connection reference
 | 
 | 334 |     </td>
 | 
 | 335 |     <td><code>jmx.server</code></td>
 | 
 | 336 |   </tr>
 | 
 | 337 | 
 | 
 | 338 |   <tr>
 | 
 | 339 |     <td>echo</td>
 | 
 | 340 |     <td>Echo command usage (access and result)
 | 
 | 341 |     </td>
 | 
 | 342 |     <td><code>false</code></td>
 | 
 | 343 |   </tr>
 | 
 | 344 | 
 | 
 | 345 |   <tr>
 | 
 | 346 |     <td>resultproperty</td>
 | 
 | 347 |     <td>Save result at this project property
 | 
 | 348 |     </td>
 | 
 | 349 |     <td></td>
 | 
 | 350 |   </tr>
 | 
 | 351 | 
 | 
 | 352 |   <tr>
 | 
 | 353 |     <td>delimiter</td>
 | 
 | 354 |     <td>Split result with delimiter (java.util.StringTokenizier) 
 | 
 | 355 |         and use resultproperty as prefix to store tokens.
 | 
 | 356 |     </td>
 | 
 | 357 |     <td></td>
 | 
 | 358 |   </tr>
 | 
 | 359 | 
 | 
 | 360 |   <tr>
 | 
 | 361 |     <td>separatearrayresults</td>
 | 
 | 362 |     <td>When return value is an array, save result as property list 
 | 
 | 363 |     (<em>$resultproperty.[0..N]</em> and <em>$resultproperty.length</em>) 
 | 
 | 364 |     </td>
 | 
 | 365 |     <td><code>true</code></td>
 | 
 | 366 |   </tr>
 | 
 | 367 | 
 | 
 | 368 | </table>
 | 
 | 369 | </p>
 | 
 | 370 | <p>
 | 
 | 371 | Example to get remote MBean attribute from default JMX connection <br>
 | 
 | 372 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 373 |   <jmx:get
 | 
 | 374 |     name="Catalina:type=Manager,path=/servlets-examples,host=localhost"
 | 
 | 375 |     attribute="maxActiveSessions"
 | 
 | 376 |     resultproperty="servlets-examples.maxActiveSessions"
 | 
 | 377 |   />
 | 
 | 378 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 379 | </p>  
 | 
 | 380 | <p>
 | 
 | 381 | Example to get and result array and split it at separate properties<br>
 | 
 | 382 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 383 |   <jmx:get
 | 
 | 384 |     name="Catalina:type=ClusterSender,host=localhost"
 | 
 | 385 |     attribute="senderObjectNames"
 | 
 | 386 |     resultproperty="senderObjectNames"
 | 
 | 387 |   />
 | 
 | 388 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 389 | Access the senderObjectNames properties with:
 | 
 | 390 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 391 |   ${senderObjectNames.length} give the number of returned sender list.
 | 
 | 392 |   ${senderObjectNames.[0..N]} found all sender object names
 | 
 | 393 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 394 | </p>  
 | 
 | 395 | 
 | 
 | 396 | <p>
 | 
 | 397 | Example to get IDataSender attribute connected only when cluster is configured.<br>
 | 
 | 398 | <em>Note:</em> The <code>name</code> attribute value was wrapped here to be
 | 
 | 399 | more readable. It has to be all on the same line, without spaces.
 | 
 | 400 | </p>
 | 
 | 401 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 402 |   <jmx:query
 | 
 | 403 |     failonerror="false"
 | 
 | 404 |     name="Catalina:type=Cluster,host=${tomcat.application.host}"
 | 
 | 405 |     resultproperty="cluster"
 | 
 | 406 |   />
 | 
 | 407 |   <jmx:get
 | 
 | 408 |     name=
 | 
 | 409 | "Catalina:type=IDataSender,host=${tomcat.application.host},
 | 
 | 410 | senderAddress=${cluster.backup.address},senderPort=${cluster.backup.port}"
 | 
 | 411 |     attribute="connected"
 | 
 | 412 |     resultproperty="datasender.connected"
 | 
 | 413 |     if="cluster.0.name" />
 | 
 | 414 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 415 | 
 | 
 | 416 | 
 | 
 | 417 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorSetTask:  set attribute value Ant task"><!--()--></a><a name="JMXAccessorSetTask:__set_attribute_value_Ant_task"><strong>JMXAccessorSetTask:  set attribute value Ant task</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 418 | <p>
 | 
 | 419 | List of Attributes<br>
 | 
 | 420 | <table border="1" cellpadding="5">
 | 
 | 421 | 
 | 
 | 422 |   <tr>
 | 
 | 423 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 424 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 425 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 426 |   </tr>
 | 
 | 427 | 
 | 
 | 428 |   <tr>
 | 
 | 429 |     <td>name</td>
 | 
 | 430 |     <td>Full qualified JMX ObjectName -- <em>Catalina:type=Server</em>
 | 
 | 431 |     </td>
 | 
 | 432 |     <td></td>
 | 
 | 433 |   </tr>
 | 
 | 434 | 
 | 
 | 435 |   <tr>
 | 
 | 436 |     <td>attribute</td>
 | 
 | 437 |     <td>Existing MBean attribute (see Tomcat MBean description above)
 | 
 | 438 |     </td>
 | 
 | 439 |     <td></td>
 | 
 | 440 |   </tr>
 | 
 | 441 | 
 | 
 | 442 |   <tr>
 | 
 | 443 |     <td>value</td>
 | 
 | 444 |     <td>value that set to attribute 
 | 
 | 445 |     </td>
 | 
 | 446 |     <td></td>
 | 
 | 447 |   </tr>
 | 
 | 448 | 
 | 
 | 449 |   <tr>
 | 
 | 450 |     <td>type</td>
 | 
 | 451 |     <td>type of the attribute.
 | 
 | 452 |     </td>
 | 
 | 453 |     <td>java.lang.String</td>
 | 
 | 454 |   </tr>
 | 
 | 455 | 
 | 
 | 456 |   <tr>
 | 
 | 457 |     <td>ref</td>
 | 
 | 458 |     <td>JMX Connection reference
 | 
 | 459 |     </td>
 | 
 | 460 |     <td><code>jmx.server</code></td>
 | 
 | 461 |   </tr>
 | 
 | 462 | 
 | 
 | 463 |   <tr>
 | 
 | 464 |     <td>echo</td>
 | 
 | 465 |     <td>Echo command usage (access and result)
 | 
 | 466 |     </td>
 | 
 | 467 |     <td><code>false</code></td>
 | 
 | 468 |   </tr>
 | 
 | 469 | 
 | 
 | 470 | </table>
 | 
 | 471 | </p>
 | 
 | 472 | <p>
 | 
 | 473 | Example to set remote MBean attribute value<br>
 | 
 | 474 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 475 |   <jmx:set
 | 
 | 476 |     name="Catalina:type=Manager,path=/servlets-examples,host=localhost"
 | 
 | 477 |     attribute="maxActiveSessions"
 | 
 | 478 |     value="500"
 | 
 | 479 |     type="int"
 | 
 | 480 |   />
 | 
 | 481 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 482 | </p>  
 | 
 | 483 | 
 | 
 | 484 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorInvokeTask:  invoke MBean operation Ant task"><!--()--></a><a name="JMXAccessorInvokeTask:__invoke_MBean_operation_Ant_task"><strong>JMXAccessorInvokeTask:  invoke MBean operation Ant task</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 485 | <p>
 | 
 | 486 | List of Attributes<br>
 | 
 | 487 | <table border="1" cellpadding="5">
 | 
 | 488 | 
 | 
 | 489 |   <tr>
 | 
 | 490 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 491 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 492 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 493 |   </tr>
 | 
 | 494 | 
 | 
 | 495 |   <tr>
 | 
 | 496 |     <td>name</td>
 | 
 | 497 |     <td>Full qualified JMX ObjectName -- <em>Catalina:type=Server</em>
 | 
 | 498 |     </td>
 | 
 | 499 |     <td></td>
 | 
 | 500 |   </tr>
 | 
 | 501 | 
 | 
 | 502 |   <tr>
 | 
 | 503 |     <td>operation</td>
 | 
 | 504 |     <td>Existing MBean operation (see Tomcat 
 | 
 | 505 |         <a href="funcspecs/fs-admin-opers.html">funcspecs/fs-admin-opers.html</a>).
 | 
 | 506 |     </td>
 | 
 | 507 |     <td></td>
 | 
 | 508 |   </tr>
 | 
 | 509 | 
 | 
 | 510 |   <tr>
 | 
 | 511 |     <td>ref</td>
 | 
 | 512 |     <td>JMX Connection reference
 | 
 | 513 |     </td>
 | 
 | 514 |     <td><code>jmx.server</code></td>
 | 
 | 515 |   </tr>
 | 
 | 516 | 
 | 
 | 517 |   <tr>
 | 
 | 518 |     <td>echo</td>
 | 
 | 519 |     <td>Echo command usage (access and result)
 | 
 | 520 |     </td>
 | 
 | 521 |     <td><code>false</code></td>
 | 
 | 522 |   </tr>
 | 
 | 523 | 
 | 
 | 524 |   <tr>
 | 
 | 525 |     <td>resultproperty</td>
 | 
 | 526 |     <td>Save result at this project property
 | 
 | 527 |     </td>
 | 
 | 528 |     <td></td>
 | 
 | 529 |   </tr>
 | 
 | 530 | 
 | 
 | 531 |   <tr>
 | 
 | 532 |     <td>delimiter</td>
 | 
 | 533 |     <td>Split result with delimiter (java.util.StringTokenizier) 
 | 
 | 534 |         and use resultproperty as prefix to store tokens.
 | 
 | 535 |     </td>
 | 
 | 536 |     <td></td>
 | 
 | 537 |   </tr>
 | 
 | 538 | 
 | 
 | 539 |   <tr>
 | 
 | 540 |     <td>separatearrayresults</td>
 | 
 | 541 |     <td>When return value is an array, save result as property list 
 | 
 | 542 |     (<em>$resultproperty.[0..N]</em> and <em>$resultproperty.length</em>) 
 | 
 | 543 |     </td>
 | 
 | 544 |     <td><code>true</code></td>
 | 
 | 545 |   </tr>
 | 
 | 546 | 
 | 
 | 547 | </table>
 | 
 | 548 | </p>
 | 
 | 549 | <p>
 | 
 | 550 | stop an application <br>
 | 
 | 551 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 552 |   <jmx:invoke
 | 
 | 553 |     name="Catalina:type=Manager,path=/servlets-examples,host=localhost"
 | 
 | 554 |     operation="stop"/>
 | 
 | 555 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 556 | Now you can find the sessionid at <em>${sessions.[0..N}</em> properties and access the count
 | 
 | 557 | with ${sessions.length} property.
 | 
 | 558 | </p>  
 | 
 | 559 | <p>
 | 
 | 560 | Example to get all sessionids <br>
 | 
 | 561 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 562 |   <jmx:invoke
 | 
 | 563 |     name="Catalina:type=Manager,path=/servlets-examples,host=localhost"
 | 
 | 564 |     operation="listSessionIds"
 | 
 | 565 |     resultproperty="sessions"
 | 
 | 566 |     delimiter=" "
 | 
 | 567 |   />
 | 
 | 568 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 569 | Now you can find the sessionid at <em>${sessions.[0..N}</em> properties and access the count
 | 
 | 570 | with ${sessions.length} property.
 | 
 | 571 | </p>  
 | 
 | 572 | <p>
 | 
 | 573 | Example to get remote MBean session attribute from session ${sessionid.0}<br>
 | 
 | 574 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 575 |   <jmx:invoke
 | 
 | 576 |     name="Catalina:type=Manager,path=/ClusterTest,host=localhost"
 | 
 | 577 |     operation="getSessionAttribute"
 | 
 | 578 |     resultproperty="hello">
 | 
 | 579 |      <arg value="${sessionid.0}"/>
 | 
 | 580 |      <arg value="Hello" />
 | 
 | 581 |   </jmx:invoke>
 | 
 | 582 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 583 | </p>
 | 
 | 584 | <p>
 | 
 | 585 | Example to create a new access logger valve at vhost <em>localhost</em>
 | 
 | 586 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 587 |  <jmx:invoke
 | 
 | 588 |          name="Catalina:type=MBeanFactory"
 | 
 | 589 |          operation="createAccessLoggerValve"
 | 
 | 590 |          resultproperty="accessLoggerObjectName"
 | 
 | 591 |  >
 | 
 | 592 |      <arg value="Catalina:type=Host,host=localhost"/>
 | 
 | 593 |  </jmx:invoke>
 | 
 | 594 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 595 | Now you can find new MBean with name stored at <em>${accessLoggerObjectName}</em>
 | 
 | 596 | property.
 | 
 | 597 | </p>  
 | 
 | 598 | 
 | 
 | 599 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorQueryTask:  query MBean Ant task"><!--()--></a><a name="JMXAccessorQueryTask:__query_MBean_Ant_task"><strong>JMXAccessorQueryTask:  query MBean Ant task</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 600 | <p>
 | 
 | 601 | List of Attributes<br>
 | 
 | 602 | <table border="1" cellpadding="5">
 | 
 | 603 | 
 | 
 | 604 |   <tr>
 | 
 | 605 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 606 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 607 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 608 |   </tr>
 | 
 | 609 | 
 | 
 | 610 |   <tr>
 | 
 | 611 |     <td>name</td>
 | 
 | 612 |     <td>JMX  ObjectName query string -- <em>Catalina:type=Manager,*</em>
 | 
 | 613 |     </td>
 | 
 | 614 |     <td></td>
 | 
 | 615 |   </tr>
 | 
 | 616 | 
 | 
 | 617 |   <tr>
 | 
 | 618 |     <td>ref</td>
 | 
 | 619 |     <td>JMX Connection reference
 | 
 | 620 |     </td>
 | 
 | 621 |     <td><code>jmx.server</code></td>
 | 
 | 622 |   </tr>
 | 
 | 623 | 
 | 
 | 624 |   <tr>
 | 
 | 625 |     <td>echo</td>
 | 
 | 626 |     <td>Echo command usage (access and result)
 | 
 | 627 |     </td>
 | 
 | 628 |     <td><code>false</code></td>
 | 
 | 629 |   </tr>
 | 
 | 630 | 
 | 
 | 631 |   <tr>
 | 
 | 632 |     <td>resultproperty</td>
 | 
 | 633 |     <td>Prefix project property name to all founded MBeans (<em>mbeans.[0..N].objectname</em>)
 | 
 | 634 |     </td>
 | 
 | 635 |     <td></td>
 | 
 | 636 |   </tr>
 | 
 | 637 | 
 | 
 | 638 |   <tr>
 | 
 | 639 |     <td>attributebinduing</td>
 | 
 | 640 |     <td>bind ALL MBean attributes in addition to <em>name</em>
 | 
 | 641 |     </td>
 | 
 | 642 |     <td><code>false</code></td>
 | 
 | 643 |   </tr>
 | 
 | 644 | 
 | 
 | 645 |   <tr>
 | 
 | 646 |     <td>delimiter</td>
 | 
 | 647 |     <td>Split result with delimiter (java.util.StringTokenizier) 
 | 
 | 648 |         and use resultproperty as prefix to store tokens.
 | 
 | 649 |     </td>
 | 
 | 650 |     <td></td>
 | 
 | 651 |   </tr>
 | 
 | 652 | 
 | 
 | 653 |   <tr>
 | 
 | 654 |     <td>separatearrayresults</td>
 | 
 | 655 |     <td>When return value is an array, save result as property list 
 | 
 | 656 |     (<em>$resultproperty.[0..N]</em> and <em>$resultproperty.length</em>) 
 | 
 | 657 |     </td>
 | 
 | 658 |     <td><code>true</code></td>
 | 
 | 659 |   </tr>
 | 
 | 660 | 
 | 
 | 661 | </table>
 | 
 | 662 | </p>
 | 
 | 663 | <p>
 | 
 | 664 | Get all Manager ObjectNames from all services and Hosts <br>
 | 
 | 665 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 666 |   <jmx:query
 | 
 | 667 |     name="Catalina:type=Manager,*
 | 
 | 668 |     resultproperty="manager" />
 | 
 | 669 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 670 | Now you can find the Session Manager at <em>${manager.[0..N].name}</em> 
 | 
 | 671 | properties and access the result object counter with ${manager.length} property.
 | 
 | 672 | </p>  
 | 
 | 673 | <p>
 | 
 | 674 | Example to get the Manager from <em>servlet-examples</em> application an bind all MBean properties<br>
 | 
 | 675 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 676 |   <jmx:query
 | 
 | 677 |     name="Catalina:type=Manager,path=/servlet-examples,host=localhost*"
 | 
 | 678 |     attributebinding="true"
 | 
 | 679 |     resultproperty="manager.servletExamples" />
 | 
 | 680 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 681 | Now you can find the manager at <em>${manager.servletExamples.0.name}</em> property
 | 
 | 682 | and can access all properties from this manager with <em>${manager.servletExamples.0.[manager attribute names]</em>}.
 | 
 | 683 | The result object counter from MBeans is stored ad ${manager.length} property.
 | 
 | 684 | </p>  
 | 
 | 685 | 
 | 
 | 686 | <p>
 | 
 | 687 | Example to get all MBeans from a server and store inside an external XML property file<br>
 | 
 | 688 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 689 | <project name="jmx.query"
 | 
 | 690 |             xmlns:jmx="antlib:org.apache.catalina.ant.jmx"
 | 
 | 691 |             default="query-all" basedir=".">
 | 
 | 692 | <property name="jmx.host" value="localhost"/>
 | 
 | 693 | <property name="jmx.port" value="8050"/>
 | 
 | 694 | <property name="jmx.username" value="controlRole"/>
 | 
 | 695 | <property name="jmx.password" value="tomcat"/>
 | 
 | 696 | 
 | 
 | 697 | <target name="query-all" description="Query all MBeans of a server">
 | 
 | 698 |   <!-- Configure connection -->
 | 
 | 699 |   <jmx:open
 | 
 | 700 |     host="${jmx.host}"
 | 
 | 701 |     port="${jmx.port}"
 | 
 | 702 |     ref="jmx.server"
 | 
 | 703 |     username="${jmx.username}"
 | 
 | 704 |     password="${jmx.password}"/>
 | 
 | 705 |   <!-- Query MBean list -->
 | 
 | 706 |   <jmx:query
 | 
 | 707 |     name="*:*"
 | 
 | 708 |     resultproperty="mbeans"
 | 
 | 709 |     attributebinding="false"/>
 | 
 | 710 | 
 | 
 | 711 |   <echoproperties
 | 
 | 712 |     destfile="mbeans.properties"
 | 
 | 713 |     prefix="mbeans."
 | 
 | 714 |     format="xml"/>
 | 
 | 715 | 
 | 
 | 716 |   <!-- Print results -->
 | 
 | 717 |   <echo message=
 | 
 | 718 |     "Number of MBeans in server ${jmx.host}:${jmx.port} is ${mbeans.length}"/>
 | 
 | 719 | </target>
 | 
 | 720 | </project>
 | 
 | 721 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 722 | Now you can find all MBeans inside the file <em>mbeans.properties</em>.
 | 
 | 723 | </p>  
 | 
 | 724 | 
 | 
 | 725 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorCreateTask:  remote create MBean Ant task"><!--()--></a><a name="JMXAccessorCreateTask:__remote_create_MBean_Ant_task"><strong>JMXAccessorCreateTask:  remote create MBean Ant task</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 726 | <p>
 | 
 | 727 | List of Attributes<br>
 | 
 | 728 | <table border="1" cellpadding="5">
 | 
 | 729 | 
 | 
 | 730 |   <tr>
 | 
 | 731 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 732 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 733 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 734 |   </tr>
 | 
 | 735 | 
 | 
 | 736 |   <tr>
 | 
 | 737 |     <td>name</td>
 | 
 | 738 |     <td>Full qualified JMX ObjectName -- <em>Catalina:type=MBeanFactory</em>
 | 
 | 739 |     </td>
 | 
 | 740 |     <td></td>
 | 
 | 741 |   </tr>
 | 
 | 742 | 
 | 
 | 743 |   <tr>
 | 
 | 744 |     <td>className</td>
 | 
 | 745 |     <td>Existing MBean full qualified class name (see Tomcat MBean description above)
 | 
 | 746 |     </td>
 | 
 | 747 |     <td></td>
 | 
 | 748 |   </tr>
 | 
 | 749 | 
 | 
 | 750 |   <tr>
 | 
 | 751 |     <td>classLoader</td>
 | 
 | 752 |     <td>ObjectName of server or web application classloader <br>
 | 
 | 753 |     ( <em>Catalina:type=ServerClassLoader,name=[server,common,shared]</em> or<br>
 | 
 | 754 |      <em>Catalina:type=WebappClassLoader,path=/myapps,host=localhost</em>) 
 | 
 | 755 |     </td>
 | 
 | 756 |     <td></td>
 | 
 | 757 |   </tr>
 | 
 | 758 | 
 | 
 | 759 |   <tr>
 | 
 | 760 |     <td>ref</td>
 | 
 | 761 |     <td>JMX Connection reference
 | 
 | 762 |     </td>
 | 
 | 763 |     <td><code>jmx.server</code></td>
 | 
 | 764 |   </tr>
 | 
 | 765 | 
 | 
 | 766 |   <tr>
 | 
 | 767 |     <td>echo</td>
 | 
 | 768 |     <td>Echo command usage (access and result)
 | 
 | 769 |     </td>
 | 
 | 770 |     <td><code>false</code></td>
 | 
 | 771 |   </tr>
 | 
 | 772 | 
 | 
 | 773 | </table>
 | 
 | 774 | </p>
 | 
 | 775 | <p>
 | 
 | 776 | Example to create remote MBean<br>
 | 
 | 777 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 778 |   <jmx:create
 | 
 | 779 |     ref="${jmx.reference}"
 | 
 | 780 |     name="Catalina:type=MBeanFactory"
 | 
 | 781 |     className="org.apache.commons.modeler.BaseModelMBean"
 | 
 | 782 |     classLoader="Catalina:type=ServerClassLoader,name=server">
 | 
 | 783 |     <arg value="org.apache.catalina.mbeans.MBeanFactory" />
 | 
 | 784 |   </jmx:create>
 | 
 | 785 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 786 | </p>  
 | 
 | 787 | <p>
 | 
 | 788 |     <b>Warning</b>: Many Tomcat MBeans can't be linked to their parent once<br>
 | 
 | 789 |     created. The Valve, Cluster and Realm MBeans are not automatically<br>
 | 
 | 790 |     connected with their parent. Use the <em>MBeanFacrory</em> create<br>
 | 
 | 791 |     operation instead.
 | 
 | 792 | </p>
 | 
 | 793 | 
 | 
 | 794 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorUnregisterTask:  remote unregister MBean Ant task"><!--()--></a><a name="JMXAccessorUnregisterTask:__remote_unregister_MBean_Ant_task"><strong>JMXAccessorUnregisterTask:  remote unregister MBean Ant task</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 795 | <p>
 | 
 | 796 | List of Attributes<br>
 | 
 | 797 | <table border="1" cellpadding="5">
 | 
 | 798 | 
 | 
 | 799 |   <tr>
 | 
 | 800 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 801 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 802 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 803 |   </tr>
 | 
 | 804 | 
 | 
 | 805 |   <tr>
 | 
 | 806 |     <td>name</td>
 | 
 | 807 |     <td>Full qualified JMX ObjectName -- <em>Catalina:type=MBeanFactory</em>
 | 
 | 808 |     </td>
 | 
 | 809 |     <td></td>
 | 
 | 810 |   </tr>
 | 
 | 811 | 
 | 
 | 812 |   <tr>
 | 
 | 813 |     <td>ref</td>
 | 
 | 814 |     <td>JMX Connection reference
 | 
 | 815 |     </td>
 | 
 | 816 |     <td><code>jmx.server</code></td>
 | 
 | 817 |   </tr>
 | 
 | 818 | 
 | 
 | 819 |   <tr>
 | 
 | 820 |     <td>echo</td>
 | 
 | 821 |     <td>Echo command usage (access and result)
 | 
 | 822 |     </td>
 | 
 | 823 |     <td><code>false</code></td>
 | 
 | 824 |   </tr>
 | 
 | 825 | 
 | 
 | 826 | </table>
 | 
 | 827 | </p>
 | 
 | 828 | <p>
 | 
 | 829 | Example to unregister remote MBean<br>
 | 
 | 830 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 831 |   <jmx:unregister
 | 
 | 832 |     name="Catalina:type=MBeanFactory"
 | 
 | 833 |   />
 | 
 | 834 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 835 | </p>  
 | 
 | 836 | <p>
 | 
 | 837 |     <b>Warning</b>: A lot of Tomcat MBeans can't be unregister.<br>
 | 
 | 838 |     The MBeans are not unlinked from their parent. Use <em>MBeanFacrory</em><br>
 | 
 | 839 |     remove operation instead.
 | 
 | 840 | </p>
 | 
 | 841 | 
 | 
 | 842 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorCondition:  express condition"><!--()--></a><a name="JMXAccessorCondition:__express_condition"><strong>JMXAccessorCondition:  express condition</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 843 | <p>
 | 
 | 844 | List of Attributes<br>
 | 
 | 845 | <table border="1" cellpadding="5">
 | 
 | 846 | 
 | 
 | 847 |   <tr>
 | 
 | 848 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 849 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 850 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 851 |   </tr>
 | 
 | 852 | 
 | 
 | 853 |  <tr>
 | 
 | 854 |     <td>url</td>
 | 
 | 855 |     <td>Set JMX connection URL - <em>service:jmx:rmi:///jndi/rmi://localhost:8050/jmxrmi</em>
 | 
 | 856 |     </td>
 | 
 | 857 |     <td></td>
 | 
 | 858 |   </tr>
 | 
 | 859 | 
 | 
 | 860 |   <tr>
 | 
 | 861 |     <td>host</td>
 | 
 | 862 |     <td>Set the host, shortcut the very long URL syntax.
 | 
 | 863 |     </td>
 | 
 | 864 |     <td><code>localhost</code></td>
 | 
 | 865 |   </tr>
 | 
 | 866 | 
 | 
 | 867 |   <tr>
 | 
 | 868 |     <td>port</td>
 | 
 | 869 |     <td>Set the remote connection port 
 | 
 | 870 |     </td>
 | 
 | 871 |     <td><code>8050</code></td>
 | 
 | 872 |   </tr>
 | 
 | 873 | 
 | 
 | 874 |   <tr>
 | 
 | 875 |     <td>username</td>
 | 
 | 876 |     <td>remote JMX connection user name.
 | 
 | 877 |     </td>
 | 
 | 878 |     <td></td>
 | 
 | 879 |   </tr>
 | 
 | 880 | 
 | 
 | 881 |   <tr>
 | 
 | 882 |     <td>password</td>
 | 
 | 883 |     <td>remote JMX connection password.
 | 
 | 884 |     </td>
 | 
 | 885 |     <td></td>
 | 
 | 886 |   </tr>
 | 
 | 887 | 
 | 
 | 888 |   <tr>
 | 
 | 889 |     <td>ref</td>
 | 
 | 890 |     <td>Name of the internal connection reference. With this attribute you can
 | 
 | 891 |         configure more the one connection inside the same Ant project.
 | 
 | 892 |     </td>
 | 
 | 893 |     <td><code>jmx.server</code></td>
 | 
 | 894 |   </tr>
 | 
 | 895 | 
 | 
 | 896 |   <tr>
 | 
 | 897 |     <td>name</td>
 | 
 | 898 |     <td>Full qualified JMX ObjectName -- <em>Catalina:type=Server</em>
 | 
 | 899 |     </td>
 | 
 | 900 |     <td></td>
 | 
 | 901 |   </tr>
 | 
 | 902 | 
 | 
 | 903 |   <tr>
 | 
 | 904 |     <td>echo</td>
 | 
 | 905 |     <td>Echo condition usage (access and result)
 | 
 | 906 |     </td>
 | 
 | 907 |     <td><code>false</code></td>
 | 
 | 908 |   </tr>
 | 
 | 909 | 
 | 
 | 910 |   <tr>
 | 
 | 911 |     <td>if</td>
 | 
 | 912 |     <td>Only execute if a property of the given name <b>exists</b> in the current project.
 | 
 | 913 |     </td>
 | 
 | 914 |     <td></td>
 | 
 | 915 |   </tr>
 | 
 | 916 | 
 | 
 | 917 |   <tr>
 | 
 | 918 |     <td>unless</td>
 | 
 | 919 |     <td>Only execute if a property of the given name <b>not exists</b> in the current project.
 | 
 | 920 |     </td>
 | 
 | 921 |     <td></td>
 | 
 | 922 |   </tr>
 | 
 | 923 | 
 | 
 | 924 |   <tr>
 | 
 | 925 |     <td>value (requiered)</td>
 | 
 | 926 |     <td>Second arg for operation
 | 
 | 927 |     </td>
 | 
 | 928 |     <td></td>
 | 
 | 929 |   </tr>
 | 
 | 930 | 
 | 
 | 931 |   <tr>
 | 
 | 932 |     <td>type</td>
 | 
 | 933 |     <td>Value type to express operation (support <em>long</em> and <em>double</em>)
 | 
 | 934 |     </td>
 | 
 | 935 |     <td><code>long</code></td>
 | 
 | 936 |   </tr>
 | 
 | 937 | 
 | 
 | 938 |   <tr>
 | 
 | 939 |     <td>operation</td>
 | 
 | 940 |     <td> express one 
 | 
 | 941 |     <ul>
 | 
 | 942 |     <li>==  equals</li>
 | 
 | 943 |     <li>!=  not equals</li>
 | 
 | 944 |     <li>> greater than (&gt;)</li>
 | 
 | 945 |     <li>>= greater than or equals (&gt;=)</li>
 | 
 | 946 |     <li>< lesser than (&lt;)</li>
 | 
 | 947 |     <li><= lesser than or equals (&lt;=)</li>
 | 
 | 948 |     </ul>         
 | 
 | 949 |     </td>
 | 
 | 950 |     <td><code>==</code></td>
 | 
 | 951 |   </tr>
 | 
 | 952 | 
 | 
 | 953 | </table>
 | 
 | 954 | </p>
 | 
 | 955 | <p>
 | 
 | 956 | Wait for server connection and that cluster backup node is accessable<br>
 | 
 | 957 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 958 | <target name="wait">
 | 
 | 959 |    <waitfor maxwait="${maxwait}" maxwaitunit="second" timeoutproperty="server.timeout" >
 | 
 | 960 |      <and>
 | 
 | 961 |        <socket server="${server.name}" port="${server.port}"/>
 | 
 | 962 |        <http url="${url}"/>
 | 
 | 963 |        <jmx:condition
 | 
 | 964 |          operation="=="
 | 
 | 965 |          host="localhost"
 | 
 | 966 |          port="9014"
 | 
 | 967 |          username="controlRole"
 | 
 | 968 |          password="tomcat"
 | 
 | 969 |          name=
 | 
 | 970 | "Catalina:type=IDataSender,host=localhost,senderAddress=192.168.111.1,senderPort=9025"
 | 
 | 971 |          attribute="connected"
 | 
 | 972 |          value="true"
 | 
 | 973 |        />
 | 
 | 974 |     </and>
 | 
 | 975 |   </waitfor>
 | 
 | 976 |   <fail if="server.timeout" message="Server ${url} don't answer inside ${maxwait} sec" />
 | 
 | 977 |   <echo message="Server ${url} alive" />
 | 
 | 978 | </target>
 | 
 | 979 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 980 | </p>  
 | 
 | 981 | 
 | 
 | 982 | </blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="JMXAccessorEqualsCondition:  equals MBean Ant condition"><!--()--></a><a name="JMXAccessorEqualsCondition:__equals_MBean_Ant_condition"><strong>JMXAccessorEqualsCondition:  equals MBean Ant condition</strong></a></font></td></tr><tr><td><blockquote>
 | 
 | 983 | <p>
 | 
 | 984 | List of Attributes<br>
 | 
 | 985 | <table border="1" cellpadding="5">
 | 
 | 986 | 
 | 
 | 987 |   <tr>
 | 
 | 988 |     <th align="center" bgcolor="aqua">Attribute</th>
 | 
 | 989 |     <th align="center" bgcolor="aqua">Description</th>
 | 
 | 990 |     <th align="center" bgcolor="aqua">Default value</th>
 | 
 | 991 |   </tr>
 | 
 | 992 | 
 | 
 | 993 |  <tr>
 | 
 | 994 |     <td>url</td>
 | 
 | 995 |     <td>Set JMX connection URL - <em>service:jmx:rmi:///jndi/rmi://localhost:8050/jmxrmi</em>
 | 
 | 996 |     </td>
 | 
 | 997 |     <td></td>
 | 
 | 998 |   </tr>
 | 
 | 999 | 
 | 
 | 1000 |   <tr>
 | 
 | 1001 |     <td>host</td>
 | 
 | 1002 |     <td>Set the host, shortcut the very long URL syntax.
 | 
 | 1003 |     </td>
 | 
 | 1004 |     <td><code>localhost</code></td>
 | 
 | 1005 |   </tr>
 | 
 | 1006 | 
 | 
 | 1007 |   <tr>
 | 
 | 1008 |     <td>port</td>
 | 
 | 1009 |     <td>Set the remote connection port 
 | 
 | 1010 |     </td>
 | 
 | 1011 |     <td><code>8050</code></td>
 | 
 | 1012 |   </tr>
 | 
 | 1013 | 
 | 
 | 1014 |   <tr>
 | 
 | 1015 |     <td>username</td>
 | 
 | 1016 |     <td>remote JMX connection user name.
 | 
 | 1017 |     </td>
 | 
 | 1018 |     <td></td>
 | 
 | 1019 |   </tr>
 | 
 | 1020 | 
 | 
 | 1021 |   <tr>
 | 
 | 1022 |     <td>password</td>
 | 
 | 1023 |     <td>remote JMX connection password.
 | 
 | 1024 |     </td>
 | 
 | 1025 |     <td></td>
 | 
 | 1026 |   </tr>
 | 
 | 1027 | 
 | 
 | 1028 |   <tr>
 | 
 | 1029 |     <td>ref</td>
 | 
 | 1030 |     <td>Name of the internal connection reference. With this attribute you can
 | 
 | 1031 |         configure more the one connection inside the same Ant project.
 | 
 | 1032 |     </td>
 | 
 | 1033 |     <td><code>jmx.server</code></td>
 | 
 | 1034 |   </tr>
 | 
 | 1035 | 
 | 
 | 1036 |   <tr>
 | 
 | 1037 |     <td>name</td>
 | 
 | 1038 |     <td>Full qualified JMX ObjectName -- <em>Catalina:type=Server</em>
 | 
 | 1039 |     </td>
 | 
 | 1040 |     <td></td>
 | 
 | 1041 |   </tr>
 | 
 | 1042 | 
 | 
 | 1043 | 
 | 
 | 1044 |   <tr>
 | 
 | 1045 |     <td>echo</td>
 | 
 | 1046 |     <td>Echo condition usage (access and result)
 | 
 | 1047 |     </td>
 | 
 | 1048 |     <td><code>false</code></td>
 | 
 | 1049 |   </tr>
 | 
 | 1050 | 
 | 
 | 1051 | </table>
 | 
 | 1052 | </p>
 | 
 | 1053 | <p>
 | 
 | 1054 | Wait for server connection and that cluster backup node is accessible<br>
 | 
 | 1055 | <div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
 | 
 | 1056 | <target name="wait">
 | 
 | 1057 |   <waitfor maxwait="${maxwait}" maxwaitunit="second" timeoutproperty="server.timeout" >
 | 
 | 1058 |     <and>
 | 
 | 1059 |       <socket server="${server.name}" port="${server.port}"/>
 | 
 | 1060 |       <http url="${url}"/>
 | 
 | 1061 |       <jmx:equals
 | 
 | 1062 |         host="localhost"
 | 
 | 1063 |         port="9014"
 | 
 | 1064 |         username="controlRole"
 | 
 | 1065 |         password="tomcat"
 | 
 | 1066 |         name=
 | 
 | 1067 | "Catalina:type=IDataSender,host=localhost,senderAddress=192.168.111.1,senderPort=9025"
 | 
 | 1068 |         attribute="connected"
 | 
 | 1069 |         value="true"
 | 
 | 1070 |       />
 | 
 | 1071 |     </and>
 | 
 | 1072 |   </waitfor>
 | 
 | 1073 |   <fail if="server.timeout" message="Server ${url} don't answer inside ${maxwait} sec" />
 | 
 | 1074 |   <echo message="Server ${url} alive" />
 | 
 | 1075 | </target>
 | 
 | 1076 | </pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
 | 
 | 1077 | </p>  
 | 
 | 1078 | 
 | 
 | 1079 | </blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade="noshade" size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
 | 
 | 1080 |         Copyright © 1999-2014, Apache Software Foundation
 | 
 | 1081 |         </em></font></div></td></tr></table></body></html> |