org.apache.catalina.ant.jmx

Class JMXAccessorGetTask

public class JMXAccessorGetTask extends JMXAccessorTask

Access JMX JSR 160 MBeans Server.

Examples:
Get a Mbean IDataSender attribute nrOfRequests and create a new ant property IDataSender.9025.nrOfRequests

   <jmx:get
           ref="jmx.server"
           name="Catalina:type=IDataSender,host=localhost,senderAddress=192.168.1.2,senderPort=9025" 
           attribute="nrOfRequests"
           resultproperty="IDataSender.9025.nrOfRequests"
           echo="false">
       />
 

First call to a remote MBeanserver save the JMXConnection a referenz jmx.server

These tasks require Ant 1.6 or later interface.

Since: 5.5.10

Version: $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $

Author: Peter Rossbach

Method Summary
StringgetAttribute()
StringgetInfo()
Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.
StringjmxExecute(MBeanServerConnection jmxServerConnection)
Execute the specified command, based on the configured properties.
protected StringjmxGet(MBeanServerConnection jmxServerConnection, String name)
voidsetAttribute(String attribute)

Method Detail

getAttribute

public String getAttribute()

Returns: Returns the attribute.

getInfo

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

jmxExecute

public String jmxExecute(MBeanServerConnection jmxServerConnection)
Execute the specified command, based on the configured properties. The input stream will be closed upon completion of this task, whether it was executed successfully or not.

Throws: BuildException if an error occurs

jmxGet

protected String jmxGet(MBeanServerConnection jmxServerConnection, String name)

Parameters: jmxServerConnection name

Returns: The value of the given named attribute

Throws: Exception

setAttribute

public void setAttribute(String attribute)

Parameters: attribute The attribute to set.

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.