tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Paquet <olivier.paq...@atos.net>
Subject MBean implements MBeanRegistration but lifecycle methods are never called
Date Thu, 17 Apr 2014 11:44:09 GMT
Hi,

I implemented an MBean exactly as described in the doc
(http://tomee.apache.org/examples-trunk/mbean-auto-registration/README.html)
and then I implemented additionally the MBeanRegistration that can be used
to intercept the MBean lifecycle. 
On TomEE start the MBean is deployed adn I can clal the method via JMX. -->
OK

But the lifecycle method are never invoked, did I forgot something?

@MBean
@Description("play with me to guess a number")
public class ConfigServiceMbean implements MBeanRegistration {
	private static Logger log = Logger.getLogger(ConfigServiceMbean.class);

	@Override
	public ObjectName preRegister(MBeanServer server, ObjectName name)
			throws Exception {
		log.debug("preRegister");
		return null;
	}

	@Override
	public void postRegister(Boolean registrationDone) {
		log.debug("postRegister");
	}

	@Override
	public void preDeregister() throws Exception {
		log.debug("preDeregister");

	}

	@Override
	public void postDeregister() {
		log.debug("postDeregister");

	}

	@ManagedOperation
	public String invokeService() {
		log.debug("invokeService() invoked");
		return "OK";
	}

}

I could not find any issue about the usage of the MBeanRegistration
interface, any known issues about that?


Thanks,

Olivier



--
View this message in context: http://openejb.979440.n4.nabble.com/MBean-implements-MBeanRegistration-but-lifecycle-methods-are-never-called-tp4668863.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message