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.Attribute ; 35 import javax.management.remote.message.MBeanServerRequestMessage; 36 import javax.management.remote.message.MBeanServerResponseMessage; 37 38 44 45 public class SetAttributeCaller extends AbstractMethodCaller { 46 47 public SetAttributeCaller(MBeanServerConnection mbsc) { 48 super(mbsc); 49 METHOD_ID = MBeanServerRequestMessage.SET_ATTRIBUTE; 50 } 51 52 public MBeanServerResponseMessage call(MBeanServerRequestMessage request) { 53 Object result = null; 54 boolean isException = false; 55 try { 56 mbsc.setAttribute((ObjectName )request.getParams()[0], 57 (Attribute )request.getParams()[1]); 58 result = null; } 60 catch(Throwable e) { 61 result = e; 62 isException = true; 63 } 64 return ( new MBeanServerResponseMessage(METHOD_ID, result, isException) ); 65 } 66 } | Popular Tags |