codahale/dropwizard — pull request #147 by arunh (2012-07-30 16:15:28+00:00)
Title: Correctly log managed object names

This fix ensures that managed objects are correctly logged at startup. Because of the use of a Set, and wrapping with JettyManaged object, before this fix you will generally see a single entry in the logged set:

DEBUG com.yammer.dropwizard.config.Environment: managed objects = [com.yammer.dropwizard.jetty.JettyManaged]

After this fix, you will see the actual classes:

DEBUG com.yammer.dropwizard.config.Environment: managed objects = [x.y.z.MemcacheAccessor, x.y.z.RandomInsultGenerator]

Managed executors are a special case, there is likely to be more than on of same instance, the fix appends the pool's name format for threads to the class name, e.g. you will see:

DEBUG com.yammer.dropwizard.config.Environment: managed objects = [com.yammer.dropwizard.lifecycle.ExecutorServiceManager(foo-{}), com.yammer.dropwizard.lifecycle.ExecutorServiceManager(bar-{})]

While we could do something even neater - giving a pool name instead of using the name format, I think this approach is probably sufficient without making bigger changes and adding new method signatures for Environment.managedExecutorService(...).

Thanks!