org.apache.tools.ant.taskdefs.optional.jmx
Class InvokeMBeanTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.optional.jmx.AbstractManagementTask
                    |
                    +--org.apache.tools.ant.taskdefs.optional.jmx.AbstractMBeanTask
                          |
                          +--org.apache.tools.ant.taskdefs.optional.jmx.InvokeMBeanTask

public class InvokeMBeanTask
extends AbstractMBeanTask

This is an Ant task that allows the operations of a JMX mbean's to be invoked Refer to the user documentation for more information and examples on how to use this task.

Version:
$Id: InvokeMBeanTask.java,v 1.6 2003/05/28 22:28:26 bdueck Exp $
Author:
Brian Dueck

Inner Class Summary
static class InvokeMBeanTask.Parameter
          Nested parameter task.
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
InvokeMBeanTask()
           
 
Method Summary
 void addParameter(InvokeMBeanTask.Parameter param)
          Adds a nested parameter element.
 boolean checkSignature(javax.management.MBeanOperationInfo operation, java.util.List parameterList)
          Compares the number of parameters required for an MBean operation and the parameter types against the values provided in parameterList.
protected  void execute(javax.management.MBeanServer mbserver)
          Process an element by invoking a method on a JMX MBean.
 javax.management.MBeanOperationInfo getOperationInfo(javax.management.MBeanInfo beanInfo, java.lang.String operationName, java.util.List parameterList)
          Finds the MBeanOperationInfo for the indicated operation name.
 javax.management.MBeanParameterInfo getParameterInfo(javax.management.MBeanOperationInfo opInfo, java.lang.String parameterName)
          Find the MBeanAttributeInfo for the indicated attribute name.
 java.lang.String getResultProperty()
          Returns the name of the Ant property the method result will be stored in.
 void setOperation(java.lang.String operation)
           
 void setResultProperty(java.lang.String resultProperty)
          Sets the name of the property to store the result (return value) of the opearation.
 
Methods inherited from class org.apache.tools.ant.taskdefs.optional.jmx.AbstractMBeanTask
execute, findAttributeInfo, getActiveDomain, getAttributes, getAttributes, getFeatureNames, getJMXServer, getName, getObjectName, removeMBeanIfExists, setMBeanRef, setName, toString
 
Methods inherited from class org.apache.tools.ant.taskdefs.optional.jmx.AbstractManagementTask
getContext, getFailOnError, getJndiName, getPassword, getProviderUrl, getUser, setContext, setContextRef, setFailOnError, setJndiName, setPassword, setProviderUrl, setServerType, setUser
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvokeMBeanTask

public InvokeMBeanTask()
Method Detail

setOperation

public void setOperation(java.lang.String operation)

setResultProperty

public void setResultProperty(java.lang.String resultProperty)
Sets the name of the property to store the result (return value) of the opearation. This is an optional property, if ommitted, the value will be stored in a property with the name .result

getResultProperty

public java.lang.String getResultProperty()
Returns the name of the Ant property the method result will be stored in. See setResultProperty() for more information.

addParameter

public void addParameter(InvokeMBeanTask.Parameter param)
Adds a nested parameter element.
Parameters:
prop - The nested parameter element.

getParameterInfo

public javax.management.MBeanParameterInfo getParameterInfo(javax.management.MBeanOperationInfo opInfo,
                                                            java.lang.String parameterName)
Find the MBeanAttributeInfo for the indicated attribute name.

getOperationInfo

public javax.management.MBeanOperationInfo getOperationInfo(javax.management.MBeanInfo beanInfo,
                                                            java.lang.String operationName,
                                                            java.util.List parameterList)
Finds the MBeanOperationInfo for the indicated operation name.

checkSignature

public boolean checkSignature(javax.management.MBeanOperationInfo operation,
                              java.util.List parameterList)
Compares the number of parameters required for an MBean operation and the parameter types against the values provided in parameterList. If no type is specified for a parameter in parameterList, no type checking is done.

execute

protected void execute(javax.management.MBeanServer mbserver)
                throws org.apache.tools.ant.BuildException
Process an element by invoking a method on a JMX MBean.
Overrides:
execute in class AbstractMBeanTask
Parameters:
mbserver - The MBeanServer that hosts the mbean.
Throws:
org.apache.tools.ant.BuildException - When an error occurs.