kazukidb/kazuki — pull request #8 by mcculls (2014-02-17 20:58:26+00:00)
Title: Explicitly bind AvailabilityManager as singleton in KeyValueStoreJdbiH2Module

Because it is used by KeyValueStoreJdbiH2Impl and otherwise Guice will fall back and create a "just-in-time" binding that can end up leaking outside the private module. When this happens the JIT binding will usually be created in the root injector, and a side-effect is that this will then stop any other private module from declaring their own AvailabilityManager bindings - leading to errors at configure time. (This usually won't show up during individual tests, only at integration time.)

Note: if the same AvailabilityManager instance should be shared between the KV store and sequence service then the binding should instead be exposed from H2SequenceServiceModule and a provider used, as already done with other shared components, like the SequenceService itself.