@ Override public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { Object result ; JMXConnector connector = null ; try { // Connect to the JMX service. connector = connect ( this . host , this . port , this . login , this . password ) ; // Create the MBean. T object = JMX . newMXBeanProxy ( connector . getMBeanServerConnection ( ) , this . objectName , this . interfaceClass ) ; // Invoke a method on the MBean. result = method . invoke ( object , args ) ; } finally { // Close the JMX service. close ( connector ) ; } return result ; }
Invoke the method and return the result .