JMX-API: Fix an endless loop in EndpointSnitchInfo

This was a code that was modified from Origin, in the JMX API
initilization is done in the custructor, which mean that it would enter
an endless loop.

When initiliation in the constructor this should be used.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
Amnon Heiman 2015-05-19 17:46:34 +03:00
parent fd244644e9
commit 0ef065ebc7

View File

@ -45,7 +45,7 @@ public class EndpointSnitchInfo implements EndpointSnitchInfoMBean {
private EndpointSnitchInfo() {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
try {
mbs.registerMBean(new EndpointSnitchInfo(), new ObjectName(
mbs.registerMBean(this, new ObjectName(
"org.apache.cassandra.db:type=EndpointSnitchInfo"));
} catch (Exception e) {
throw new RuntimeException(e);