1 22 package org.jboss.test.jmx.mbeancrashtest; 23 24 import org.jboss.system.*; 25 import javax.management.*; 26 27 public class Test extends ServiceMBeanSupport implements TestMBean{ 28 boolean crash = false; 29 ObjectName name = null; 30 public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { 31 crash = name.getKeyProperty("name").equals("Crash"); 32 log.info("crash="+crash); 33 this.name=name; 34 return super.preRegister(server,name); 35 } 36 public String getName(){ 37 return name.toString(); 38 } 39 public void startService() throws Exception { 40 log.info("starting"); 41 if (crash) 42 throw new Exception ("Crashing on purpose"); 43 log.info("Started!"); 44 } 45 46 47 } 48 | Popular Tags |