bootstrap.setConfigurationFactoryFactory((klass, validator, objectMapper, propertyPrefix) -> new POJOConfigurationFactory<>(getConfiguration())); } else if (customPropertyPrefix.isPresent()) { bootstrap.setConfigurationFactoryFactory((klass, validator, objectMapper, propertyPrefix) -> new YamlConfigurationFactory<>(klass, validator, objectMapper, customPropertyPrefix.get()));
@Override public void initialize(Bootstrap<?> bootstrap) { final InjectableValues injectableValues = new InjectableValues() { @Override public Object findInjectableValue(Object valueId, DeserializationContext ctxt, BeanProperty forProperty, Object beanInstance) { return null; } }; final ConfigurationFactoryFactory<? extends Configuration> configurationFactoryFactory = bootstrap.getConfigurationFactoryFactory(); ConfigurationFactoryFactory factoryFactory = new ConfigurationFactoryFactory() { @Override public ConfigurationFactory create(Class klass, Validator validator, ObjectMapper objectMapper, String propertyPrefix) { objectMapper.setInjectableValues(injectableValues); //noinspection unchecked return configurationFactoryFactory.create(klass, validator, objectMapper, propertyPrefix); } }; //noinspection unchecked bootstrap.setConfigurationFactoryFactory(factoryFactory); }
bootstrap.setConfigurationFactoryFactory((klass, validator, objectMapper, propertyPrefix) -> new POJOConfigurationFactory<>(getConfiguration())); } else if (customPropertyPrefix.isPresent()) { bootstrap.setConfigurationFactoryFactory((klass, validator, objectMapper, propertyPrefix) -> new YamlConfigurationFactory<>(klass, validator, objectMapper, customPropertyPrefix.get()));
@Override public void initialize(Bootstrap<C> bootstrap) { if (configurationBridge != null) { bootstrap.setConfigurationFactoryFactory(new BridgedConfigurationFactoryFactory<C>(configurationBridge)); } // Swaps the default FileConfigurationSourceProvider bootstrap.setConfigurationSourceProvider(new ClasspathConfigurationSourceProvider()); dropwizardApplication.initialize(bootstrap); }
@Override public final void initialize(Bootstrap<T> bootstrap) { bootstrap.setConfigurationFactoryFactory(builder.getFactoryFactory()); bootstrap.setConfigurationSourceProvider(new FlexibleConfigurationSourceProvider()); ConfiguredBundle<T> bundle = new ConfiguredBundle<T>() { @Override public void run(T configuration, Environment environment) throws Exception { DefaultServerFactory factory = new DefaultServerFactory(); factory.setAdminConnectors(Lists.<ConnectorFactory>newArrayList()); configuration.setServerFactory(factory); } @Override public void initialize(Bootstrap<?> bootstrap) { // NOP } }; addBundles(bootstrap, BundleSpec.Phase.PRE_SOA); bootstrap.addBundle(bundle); bootstrap.addBundle(new SoaBundle<>()); bootstrap.addBundle(new ComponentBundle(builder.getAppName(), builder.getCompanyName(), builder.getFooterMessage(), builder.getTabs(), builder.getMetrics(), builder.getAuthSpec())); bootstrap.addBundle(new AssetsBundle("/assets/soa")); addBundles(bootstrap, BundleSpec.Phase.POST_SOA); }