FileDocCategorySizeDatePackage
InvokeCaller.javaAPI DocGlassfish v2 API3545Fri May 04 22:36:28 BST 2007com.sun.enterprise.admin.jmx.remote.server.callers

InvokeCaller

public class InvokeCaller extends AbstractMethodCaller
Invokes the method invoke of the MBeanServerConnection.
see
MBeanServerRequestMessage#INVOKE
author
Kedar Mhaswade
since
S1AS8.0
version
1.0

Fields Summary
Constructors Summary
public InvokeCaller(MBeanServerConnection mbsc)
Creates a new instance of CreateMBeanCaller

		super(mbsc);
		METHOD_ID = MBeanServerRequestMessage.INVOKE;
	
Methods Summary
public javax.management.remote.message.MBeanServerResponseMessagecall(javax.management.remote.message.MBeanServerRequestMessage request)

		Object result = null;
		boolean isException = false;
		try {
			result = mbsc.invoke(
			(ObjectName)request.getParams()[0],
			(String) request.getParams()[1],
			(Object[]) request.getParams()[2],
			(String[]) request.getParams()[3]);
		}
		catch(Throwable e) {
			 /*
			 generally it is better to have an exception caught, but since
			 the jmx connector is expected to preserve the Exception StackTrace,
			 I am catching Throwable. This is true with other callers too.
			 */
			result = e;
			isException = true;
		}
		return ( new MBeanServerResponseMessage(METHOD_ID, result, isException) );