package com.proofpoint.jmx;

import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;
import com.proofpoint.configuration.ConfigurationModule;

import javax.management.MBeanServer;
import java.lang.management.ManagementFactory;

public class JMXModule
        implements Module
{
    @Override
    public void configure(Binder binder)
    {
        binder.bind(MBeanServer.class).toInstance(ManagementFactory.getPlatformMBeanServer());
        binder.bind(JMXAgent.class).in(Scopes.SINGLETON);
        ConfigurationModule.bindConfig(binder, JMXConfig.class);
    }
}


@@ -177,16 +177,102 @@
 nModule;
+%0Aimport org.weakref.jmx.guice.ExportBuilder;%0Aimport org.weakref.jmx.guice.MBeanModule;
 %0A%0Aimport
@@ -679,16 +679,157 @@
 .class);
+%0A%0A        ExportBuilder builder = MBeanModule.newExporter(binder);%0A        builder.export(StackTraceMBean.class).withGeneratedName();        
 %0A    %7D%0A%7D

Add a StackTraceMBean to the JMX package.