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 public class CreateMBeanCaller extends AbstractMethodCaller { 44 45 46 public CreateMBeanCaller(MBeanServerConnection mbsc) { 47 super(mbsc); 48 METHOD_ID = MBeanServerRequestMessage.CREATE_MBEAN; 49 } 50 51 public MBeanServerResponseMessage call(MBeanServerRequestMessage request) { 52 Object result = null; 53 boolean isException = false; 54 try { 55 result = mbsc.createMBean((String )request.getParams()[0], 56 (ObjectName )request.getParams()[1]); 57 } 58 catch(Throwable e) { 59 result = e; 60 isException = true; 61 } 62 return ( new MBeanServerResponseMessage(METHOD_ID, result, isException) ); 63 } 64 } | Popular Tags |