FileDocCategorySizeDatePackage
JMXAccessorUnregisterTask.javaAPI DocApache Tomcat 6.0.143677Fri Jul 20 04:20:30 BST 2007org.apache.catalina.ant.jmx

JMXAccessorUnregisterTask

public class JMXAccessorUnregisterTask extends JMXAccessorTask
unregister a MBean at JMX JSR 160 MBeans Server.
  • unregister Mbeans

Examples:
unregister an existing Mbean at jmx.server connection

<jmx:unregister
ref="jmx.server"
name="Catalina:type=MBeanFactory" />

WARNINGNot all Tomcat MBeans can successfully unregister remotely. The mbean unregistration don't remove valves, realm, .. from parent class. Please, use the MBeanFactory operation to remove valves and realms.

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

These tasks require Ant 1.6 or later interface.
author
Peter Rossbach
version
$Revision: 500684 $
since
5.5.12

Fields Summary
private static final String
info
Descriptive information describing this implementation.
Constructors Summary
Methods Summary
public java.lang.StringgetInfo()
Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.

return
Returns the class info.


                             
       

        return (info);

    
public java.lang.StringjmxExecute(javax.management.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.

exception
Exception if an error occurs


        if (getName() == null) {
            throw new BuildException("Must specify a 'name'");
        }
        return  jmxUuregister(jmxServerConnection, getName());
     
protected java.lang.StringjmxUuregister(javax.management.MBeanServerConnection jmxServerConnection, java.lang.String name)
Unregister Mbean

param
jmxServerConnection
param
name
return
The value of the given named attribute
throws
Exception

        String error = null;
        if(isEcho()) {
            handleOutput("Unregister MBean " + name  );
        }
        jmxServerConnection.unregisterMBean(
                new ObjectName(name));
        return error;