This content has been marked as final.
Show 1 reply
-
1. Re: Calling MBean from EJB...
juha Sep 12, 2003 9:25 AM (in response to cobraflow)There's no need to bind the MBean to JNDI, only one JMX connector.
Locally, find the MBean server reference your JBoss is running on (there's a helper class MBeanServerLocator for this) and use the MBean server interface to invoke/set/getAttribute.
Remotely, lookup a connector (JBoss RMI Connector for instance) from the remote naming service and use the connector to invoke your MBean.
If you want complete location transparency, you should always go through the naming lookup and invoker via connector. Notice though that at least the basic JMX connectors haven't been optimized for local calls (you will pay the serialization price even for local invocation -- sometimes acceptable for infrequently called MBeans).
-- Juha