[jboss-dev-forums] [Design of JBossCache] - Re: Injection of MBeanServer
bstansberry@jboss.com
do-not-reply at jboss.com
Sun Nov 5 14:29:06 EST 2006
Thanks. The use of the annotation is what I'd read and forgotten. I thought the "inject the MBeanServer via a property" approach seemed too hacky!
"scott.stark at jboss.org" wrote :
| The org.jboss.test.microcontainer.test.JMXDecoratedTestCase illustrates the use of a JMX annotation and associated org.jboss.aop.microcontainer.aspects.jmx.JMXIntroduction which handles the registration of a simple bean like:
|
|
| | package org.jboss.test.microcontainer.support;
| |
| | import org.jboss.aop.microcontainer.aspects.jmx.JMX;
| |
| | @JMX(name="test:name=AnnotatedBean", exposedInterface=SimpleBeanImplMBean.class)
| | public class SimpleBeanAnnotatedImpl extends SimpleBeanImpl
| | {
| | }
| |
|
| Let's get this fleshed out with Kabir's help.
|
OK. For clustering the part I'm going to want to be sure works well is overriding the @JMX name attribute via XML. Most clustering beans can be deployed multiple times with different partitions, with the partition name as an attribute of the ObjectName. And of course there can be multiple JBC instances in the server.
Manik, one thing this implies is a compile-time dependency in JBC on the microcontainer jars. I think that was an inevitability anyway. We could avoid this by having the JMX integration in the AS cluster module or the fledgling cluster project, but that seems ugly.
anonymous wrote :
| In the interim if you run into issues, I would look at creating a CacheJmxWrapper that exposes the mbean interface and delegates to the pojo cache to make sure jmx is fully separated out of the core.
|
I did that this morning; even named the class "CacheJmxWrapper". Pending sorting out use of @JMX, it knows how to register itself w/ JMX if the MC injects an MBeanServer, a la AspectManager. That may be how I leave it for the next week or so while I focus on getting all the AS clustering code working with the new JBC 2.0 API.
This class will probably also be the basis for integrating JBC 2.0 in the old JMX Microkernel.
There's still legacy code in TreeCache that let's TreeCache register itself w/ JMX; I'll remove that tomorrow once others get a chance to read this thread and express any opinions.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983319#3983319
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983319
More information about the jboss-dev-forums
mailing list