org.apache.catalina.ant.jmx

Class JMXAccessorSetTask

public class JMXAccessorSetTask extends JMXAccessorTask

Access JMX JSR 160 MBeans Server.

Examples: Set a Mbean Manager attribute maxActiveSessions. Set this attribute with fresh jmx connection without save reference

   <jmx:set
           host="127.0.0.1"
           port="9014"
           ref=""
           name="Catalina:type=Manager,path="/ClusterTest",host=localhost" 
           attribute="maxActiveSessions"
           value="100"
           type="int"
           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>.
protected StringgetMBeanAttributeType(MBeanServerConnection jmxServerConnection, String name, String attribute)
Get MBean Attriute from Mbean Server
StringgetType()
StringgetValue()
booleanisConvert()
StringjmxExecute(MBeanServerConnection jmxServerConnection)
Execute the specified command, based on the configured properties.
protected StringjmxSet(MBeanServerConnection jmxServerConnection, String name)
voidsetAttribute(String attribute)
voidsetConvert(boolean convert)
voidsetType(String valueType)
voidsetValue(String value)

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>.

getMBeanAttributeType

protected String getMBeanAttributeType(MBeanServerConnection jmxServerConnection, String name, String attribute)
Get MBean Attriute from Mbean Server

Parameters: jmxServerConnection name attribute

Returns: The type

Throws: Exception

getType

public String getType()

Returns: Returns the type.

getValue

public String getValue()

Returns: Returns the value.

isConvert

public boolean isConvert()

Returns: Returns the convert.

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: Exception if an error occurs

jmxSet

protected String jmxSet(MBeanServerConnection jmxServerConnection, String name)

Parameters: jmxServerConnection name

Throws: Exception

setAttribute

public void setAttribute(String attribute)

Parameters: attribute The attribute to set.

setConvert

public void setConvert(boolean convert)

Parameters: convert The convert to set.

setType

public void setType(String valueType)

Parameters: valueType The type to set.

setValue

public void setValue(String value)

Parameters: value The value to set.

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