1 22 package org.jboss.jmx.connector.invoker; 23 24 import javax.management.MBeanServerConnection ; 25 import javax.management.ObjectName ; 26 27 import org.jboss.deployment.DeploymentException; 28 import org.jboss.mx.util.MBeanProxyExt; 29 import org.jboss.system.ServiceMBeanSupport; 30 31 37 public class MBeanProxyRemote extends ServiceMBeanSupport implements MBeanProxyRemoteMBean 38 { 39 40 private ObjectName mbeanServerConnection; 41 42 47 public ObjectName getMBeanServerConnection() 48 { 49 return mbeanServerConnection; 50 } 51 52 57 public void setMBeanServerConnection(ObjectName mbeanServerConnection) 58 { 59 this.mbeanServerConnection = mbeanServerConnection; 60 } 61 62 protected void startService() throws Exception 63 { 64 if (MBeanProxyExt.remote != null) 65 throw new IllegalStateException ("Remote MBeanServerConnection is already set " + MBeanProxyExt.remote); 66 67 Object o = server.getAttribute(mbeanServerConnection, "Proxy"); 68 if (o instanceof MBeanServerConnection == false) 69 throw new DeploymentException(mbeanServerConnection + " does not define an MBeanServerConnection"); 70 MBeanProxyExt.remote = (MBeanServerConnection ) o; 71 } 72 73 protected void stopService() throws Exception 74 { 75 MBeanProxyExt.remote = null; 76 } 77 } 78 | Popular Tags |