@Override protected void configure() { bind(HoneycombConfiguration.class).toInstance(configuration); for (AdapterType adapter : AdapterType.values()) { if (configuration.isAdapterConfigured(adapter)) { try { Class<?> moduleClass = Class.forName(adapter.getModuleClass()); Constructor<?> moduleCtor = moduleClass.getConstructor(Map.class); Object module = moduleCtor.newInstance(configuration.getAdapterOptions(adapter)); install((Module) module); } catch (ClassNotFoundException e) { logger.error("The " + adapter.getName() + " adapter is" + " configured, but could not be found on the classpath."); throw new StorageBackendCreationException(adapter.getName(), e); } catch (Exception e) { logger.error("Exception while attempting to reflect on the " + adapter.getName() + " adapter.", e); throw new StorageBackendCreationException(adapter.getName(), e); } } } } }