use case for "cascading"

Accroding to two previous threads:

http://forum.java.sun.com/thread.jspa?threadID=5123284

http://forum.java.sun.com/thread.jspa?threadID=790563

A cascading situation is like:

JVM-1 + MBeanServer-1 + MBean-1

JVM-2 + MBeanServer-2 + MBean-2

So MBeanServer-1, as master, can see proxied MBean-2 when cascading is supported in JMX 2.0, or other proprietary products like Java DMK.

Here is my question. Do you think following situation is a cascading as well when I want to remotely register MBean-2 to MBeanServer-1?

JVM-1 + MBeanServer-1 + MBean-1

JVM-2 + MBean-2

Meanwhile, I am reading JMX 1.4 SPEC and trying to find out the answer myself.

Thanks,

Rex

[730 byte] By [rexyounga] at [2007-11-26 15:25:36]
# 1

Okay, JMX 1.4 SPEC says that a remote JVM can use Connectors to obtain an instance of MBeanServerConnection. Using the instance remote JVM can operate almostly like a local app. But it does not provide the register mothed, which means no remote MBean is allowed. Developer has to do his own work. For example, use proxy pattern.

The question still remains as how does JMX 2.0 support remote MBeans? Does it must be contained by a MBeanServer? And then MBeanServer talks to MBeanServer?

Thanks,

Rex

rexyounga at 2007-7-8 21:41:11 > top of Java-index,Core,Monitoring & Management...
# 2

Hi,

There's no registerMBean(), but you could use createMBean() instead.

However it mostly depends what the MBean you want to create is supposed to do.

If you have JVM-1/MBeanServer-1 which is the master,

and JVM-2/MBeanServer-2 which wants to 'register' an MBean (MBean-2) in MBeanServer-1,

and if you use a JMXConnetor to connect to JVM-1 and call createMBean(), then the

MBean will be physically created in JVM-1 and will have no tie to JVM-2.

Any operation invoked on MBean-2 will be executed within JVM-1.

On the other hand, you can register MBean-2 in MBeanServer-2, and then create a

proxy MBean-2' in MBeanServer-1 that uses a JMXConnector to forward all its operations

to MBean-2 in JVM-2. Then any operation invoked on MBean2' will be forwarded

to MBean2 and executed within JVM-2.

This is the principle of "cascading".

We didn't put any registerMBean operation on MBeanServerConnection on purpose,

because we felt such an operation would have been misleading. What would have

happened is that MBean-2 created on JVM-2 would have been serialized and sent

over the wire to JVM-1. You would then have had two copies of MBean-2: one in

JVM-2 (the original) and one in JVM-2 (the deserialized clone) - with no ties

betwen them.

Invoking an operation on the clone MBean in JVM-1 would then have no effect on

the original in JVM-2 and conversely.

Hope this helps,

-- daniel

http://blogs.sun.com/jmxetc

null

dfuchsa at 2007-7-8 21:41:11 > top of Java-index,Core,Monitoring & Management...