An Ant plugin to call jmx operations and set and get attributes on MBeans in JBoss.
To use this plugin with Ant, place the jbossjmx-ant.jar together with the jboss jars jboss-j2ee.jar and jboss-common-client.jar, and the sun jnet.jar in the ant/lib directory you wish to use.
To define the task, include something like this in your ant script:
<taskdef name="jmx" classname="org.jboss.ant.JMX"> </taskdef>
As an alternative, instead of copying required libraries in the ant/lib directory you can specify them in "taskdef" task. For example
<taskdef name="jmx" classname="org.jboss.ant.JMX"> <classpath> <pathelement path="${jboss.home}/client/jbossjmx-ant.jar"/> <pathelement path="${jboss.home}/client/jbossall-client.jar"/> </classpath> </taskdef>
What you can do:
<propertyEditor type="java.math.BigDecimal" editor="org.jboss.util.propertyeditor.BigDecimalEditor"/>
<invoke target="jboss.system:service=MainDeployer" operation="deploy"> <parameter type="java.lang.String" arg="file:${basedir}/jython.jar"/> </invoke>
<invoke target="jboss.system:service=MainDeployer" operation="doSomething" property="some.property"> <parameter type="java.lang.String" arg="file:${basedir}/jython.jar"/> </invoke>
<setAttribute target="jboss.system:service=MainDeployer" attribute="SomeAttribute" value="SomeValue"/>
<getAttribute target="jboss.system:service=MainDeployer" attribute="SomeAttribute" property="SomeProperty"/>