1 23 24 29 30 package com.sun.enterprise.admin.jmx.remote.server.callers; 31 32 import javax.management.MBeanServerConnection ; 33 import javax.management.ObjectName ; 34 import javax.management.remote.message.MBeanServerRequestMessage; 35 import javax.management.remote.message.MBeanServerResponseMessage; 36 37 43 44 public class InvokeCaller extends AbstractMethodCaller { 45 46 47 public InvokeCaller(MBeanServerConnection mbsc) { 48 super(mbsc); 49 METHOD_ID = MBeanServerRequestMessage.INVOKE; 50 } 51 52 public MBeanServerResponseMessage call(MBeanServerRequestMessage request) { 53 Object result = null; 54 boolean isException = false; 55 try { 56 result = mbsc.invoke( 57 (ObjectName )request.getParams()[0], 58 (String ) request.getParams()[1], 59 (Object []) request.getParams()[2], 60 (String []) request.getParams()[3]); 61 } 62 catch(Throwable e) { 63 68 result = e; 69 isException = true; 70 } 71 return ( new MBeanServerResponseMessage(METHOD_ID, result, isException) ); 72 } 73 } 74 | Popular Tags |