I have an existing DataSource that EJB's use. My EJB's have <resource-ref>s that point to the DataSource, and they can look up and use the DataSource fine.
Now I have an MBean (and associated helper code) that needs to use the same DataSource. But it cannot look up the DataSource by the same JNDI name that the EJBs use (java:comp/env/blahblahblah). Can I define a JNDI name for the DataSource (other than its "raw" JNDI name as declared in the <resource-manager> element) that my MBean can lookup? IOW, is there an equivalent to <resource-ref> for MBeans?
I've noticed that servlets can declare <resource-ref> in the web.xml, so I'm hoping MBeans have similar capability.
MBeans do not currently have that capability. The spec is happily unaware of J2EE platform, and the J2EE platform more or less ignores the MBean components. And we don't provide that mapping as part of our proprietary SAR format.