1 22 package org.objectweb.petals.tools.ant.util; 23 24 import javax.jbi.JBIException; 25 import javax.management.MBeanServer ; 26 import javax.management.ObjectName ; 27 28 33 public class InstallerMoc implements InstallerMocMBean { 34 35 private MBeanServer beanServer; 36 37 private ObjectName objectName; 38 39 public InstallerMoc(MBeanServer beanServer) { 40 super(); 41 this.beanServer = beanServer; 42 } 43 44 public ObjectName getInstallerConfigurationMBean() throws JBIException { 45 return null; 46 } 47 48 public String getInstallRoot() { 49 return null; 50 } 51 52 public ObjectName install() throws JBIException { 53 try { 54 objectName = new ObjectName ("org.objectweb.petals:type=binding,name=foo001"); 55 AdminServiceMoc.bindingsCompo.add(objectName); 56 beanServer.registerMBean(new LifeCycleMoc(), objectName); 57 } 58 catch (Exception e) { 59 e.printStackTrace(); 60 } 61 return objectName; 62 } 63 64 public boolean isInstalled() { 65 return false; 66 } 67 68 public void uninstall() throws JBIException { 69 AdminServiceMoc.bindingsCompo.remove(objectName); 70 } 71 72 } 73 | Popular Tags |