EVALUATION
Cascading is a special case of a more general notion, that of constructing a hierarchy of MBeanServers. The idea is that within an MBeanServer mbs1, you can specify that another MBeanServer mbs2 appears as "mbs2//", for example. So if you do mbs1.getAttribute("mbs2//d:k=v", "Foo"), that ends up calling mbs2.getAttribute("d:k=v"). mbs2 can be any object that implements the MBeanServer interface. It can be a reference to a remote MBeanServer via a connector, which is the basis for building cascading. It can be an object that constructs the referenced MBeans on demand, which is the basis for Virtual MBeans (see CR 5108739).
"mbs2//" is called a "namespace", and is created by registering an MBean of the class JMXNamespace (or a subclass), with the special ObjectName "mbs2//:type=JMXNamespace". The JMXNamespace MBean is given an instance of MBeanServer that is the MBeanServer that appears as "mbs2//...", mbs2 in the example.
The characters "//" in the domain part of an ObjectName indicate a path in the hierarchy. Previously, mbs1.getAttribute("mbs2//d:k=v", "Foo") just looked for an MBean of that name in mbs1. Now, it looks for a namespace called "mbs2//" and does getAttribute("d:k=v", "Foo") within it.
The meaning of * in an ObjectName is adjusted so that it does not match the separator "//". Therefore if you call mbs1.queryNames(new ObjectName("*:*"), null), you will not see the MBeans within mbs2, whose names begin with "mbs2//". On the other hand, if you call mbs1.queryNames(new ObjectName("mbs2//*:*"), null), you *will* see those MBeans, for example "mbs2//d:k=v".
For further details, consult the documentation of package javax.management.namespaces in the documentation reachable from the JSR 255 pages at <http://jcp.org/en/jsr/detail?id=255>.
|