Class SlowQueryReportJmx.Registration

java.lang.Object
org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx.Registration
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, SlowQueryReportJmx.RegistrationMBean, SlowQueryReportJmxMBean
Enclosing class:
SlowQueryReportJmx

public static class SlowQueryReportJmx.Registration extends Object implements NotificationEmitter, SlowQueryReportJmx.RegistrationMBean
The resource published with the MBeanServer for one pool.

It holds the name, the statistics store of the pool it reports for, and that pool's JMX state, and nothing else: every attribute and operation it serves reads the store and the pool's broadcaster exactly as an interceptor instance of the pool would. Keeping the pool out of the resource is the point: the MBeanServer outlives a pool that was abandoned without closing, and a resource that reached the pool would pin it, its sessions and its classloader for the life of the JVM, since a registration is only ever taken down by a close the abandoned pool never runs. The published surface is unchanged by this indirection: SlowQueryReportJmxMBean plus the notification methods of NotificationEmitter, with listeners landing on the pool's shared broadcaster.

The ObjectName is deliberately not among what it holds: the name a publication occupies is recorded by the pool's SlowQueryReportJmx.PoolJmx, which is also what gives it up, so the resource cannot be the one to give up a name other than the one it was published under - and does not need to know any.

The class is public because the Standard-MBean introspection publishes the resource through its interfaces; instances are created only by SlowQueryReportJmx.registerJmx().