Resources can be JMX managed by exposing a management interface and registering as an MBean.
Example showing configuration of MBean event listeners.
MBeans can implement the MBeanRegistration interface to find the ObjectName and MBeanServer they're registered with.
Example showing JMX-managed resources using the MBeanServer API.