User: d_jencks
Date: 01/11/30 07:48:05
Added: src/main/org/jboss/test/jmx/mbeancrashtest Test.java
TestMBean.java
Log:
added test for mbean crashing during start, thanks to David Budworth
Revision Changes Path
1.1 jbosstest/src/main/org/jboss/test/jmx/mbeancrashtest/Test.java
Index: Test.java
===================================================================
/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.test.jmx.mbeancrashtest;
/**
* @see <related>
* @author <a href="mailto:[EMAIL PROTECTED]">David Budworth</a>
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
* @version $$
*/
import org.jboss.system.*;
import javax.management.*;
public class Test extends ServiceMBeanSupport implements TestMBean{
boolean crash = false;
ObjectName name = null;
public ObjectName preRegister(MBeanServer server, ObjectName name) throws
Exception{
crash = name.getKeyProperty("name").equals("Crash");
log.info("crash="+crash);
this.name=name;
return super.preRegister(server,name);
}
public String getName(){
return name.toString();
}
public void start() throws Exception{
log.info("starting");
if (crash)
throw new Exception("Crashing on purpose");
log.info("Started!");
super.start();
}
}
1.1
jbosstest/src/main/org/jboss/test/jmx/mbeancrashtest/TestMBean.java
Index: TestMBean.java
===================================================================
/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.test.jmx.mbeancrashtest;
/**
* @see <related>
* @author <a href="mailto:[EMAIL PROTECTED]">David Budworth</a>
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
* @version $$
*/
import org.jboss.system.*;
interface TestMBean extends ServiceMBean {
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development