I usually include an attribute (Instance) and create a getInstance MBean method. Have it return "this". For looser coupling, create an interface with the methods you want to expose.
The JBoss folk seem to follow this approach.
You can also have one mbean construct the other, and you can hold a reference in the first. (Method "registerMBean".)
You could use org.jboss.mx.util.MBeanProxy which gives you a
dynamic proxy based instance of the MBean so that you can call the
MBean methods directly on the proxy object.
For example, if you have an MBean, say MyService, that implements
MyServiceMBean and is registered with an MBean ObjectName of, say,
foo:service=MyService then any other MBean can get a reference
to this MBean and call methods on it as follows:
ObjectName fooName = new ObjectName("foo:service=MyService");
MyServiceMBean myServiceMBean =
The dynamic proxy completely hides the MBeanServer invocation so that
you can use it as if it were an instance of the MBean object.
FWIW, there is no "official JMX" way to do this ... one of the points of
the MBeanServer invoke() method is that the invoker doesn't have to have
a reference to the java.lang.Class of the object that it's invoking methods
on ... this avoids lots of problems with ClassLoaders and redeployment.
Also, genman's comments about using interfaces is wise, especially if you
want to be able to redeploy one MBean whilst leaving the other one running!
You will not find an "official" way to do this in the JMX spec as the main purpose of the architecture and JMX API design is to hide the actual component references to force a loosely coupled in VM relationships.