martint/jmxutils — comment on commit 4c7e54e261dfd6242f119a8d1135108277fb7cee
File: src/main/java/org/weakref/jmx/guice/InternalMBeanModule.java line 30
By jhartlaub:

I encourage adopting this commit. GuiceMBeanExporter is not visible to client code and cannot be directly referenced or instantiated- it is the responsibility of the library to make sure this class gets instantiated (via Guice).

Since Guice's "SINGLETON" does not guarantee instantiation due to the defined semantics of SINGLETON with respect to Stage.DEVELOPMENT vs Stage.PRODUCTION (see http://code.google.com/p/google-guice/wiki/Scopes under "Eager Singletons"), the library does not work when starting an application up with the default Stage.DEVELOPMENT injector.

The purpose of DEVELOPMENT vs PRODUCTION stages are to optimize different uses of Guice- not to change the injection results but rather to amortize (or not) the cost of the injection - I think the library should be made to work with either stage - adopt the asEagerSingleton() approach or explicitly make sure the GuiceMBeanExporter is instantiated.