scylla-jmx/src/main/java/org/apache/cassandra
Piotr Jastrzebski 2c48bab91a Use JmxMBeanServer instead of MBeanServer
JmxMBeanServer is a concrete implementation of a MBeanServer.
We want to use it directly because we need to bypass calls to
JmxMBeanServer.registerMBean and JmxMBeanServer.unregisterMBean.
They take ObjectName as parameter, copy it using
ObjectName.getInstance(ObjectName) and pass it to registerMBean
and unregisterMBean of JmxMBeanServer.getMBeanServerInterceptor().
We want to avoid this copy and pass the ObjectName argument directly
to JmxMBeanServer.getMBeanServerInterceptor().

To do that this patch:
1. changes all MBeanServer variables to JmxMBeanServer
2. creates JmxMBeanServer in APIBuilder making sure accessing
   interceptors is allowed
3. makes sure that JmxMBeanServer.getMBeanServerInterceptor().registerMBean
   is called wherever JmxMBeanServer.registerMBean was called
4. makes sure that JmxMBeanServer.getMBeanServerInterceptor().unregisterMBean
   is called whenever JmxMBeanServer.unregisterMBean was called

Next patch will use different ObjectName implementation that will
use less memory and this patch is crucial because without it every ObjectName
is transformed with ObjectName.getInstance which turns the object into
a regular ObjectName.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2018-05-12 18:35:18 +02:00
..
db Use JmxMBeanServer instead of MBeanServer 2018-05-12 18:35:18 +02:00
gms FailureDetector: check that states is not null before use 2018-03-29 15:18:48 +03:00
locator Code formatting + source cleanup (eclipse) 2016-10-24 11:43:52 +00:00
metrics Use JmxMBeanServer instead of MBeanServer 2018-05-12 18:35:18 +02:00
net Code formatting + source cleanup (eclipse) 2016-10-24 11:43:52 +00:00
repair Add the RepairParallelism enum 2015-08-27 20:46:02 +03:00
service StorageService: Allow querying the view build status 2018-04-03 14:43:27 +03:00
streaming Code formatting + source cleanup (eclipse) 2016-10-24 11:43:52 +00:00