当前位置: 首页>>代码示例>>Java>>正文


Java Bootstrap.setConfigurationSourceProvider方法代码示例

本文整理汇总了Java中io.dropwizard.setup.Bootstrap.setConfigurationSourceProvider方法的典型用法代码示例。如果您正苦于以下问题:Java Bootstrap.setConfigurationSourceProvider方法的具体用法?Java Bootstrap.setConfigurationSourceProvider怎么用?Java Bootstrap.setConfigurationSourceProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.dropwizard.setup.Bootstrap的用法示例。


在下文中一共展示了Bootstrap.setConfigurationSourceProvider方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<StubEventSinkConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );
    
    GuiceBundle<StubEventSinkConfiguration> guiceBundle = defaultBuilder(StubEventSinkConfiguration.class)
            .modules(new StubEventSinkModule())
            .build();
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:18,代码来源:StubEventSinkApplication.java

示例2: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<SamlProxyConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    guiceBundle = defaultBuilder(SamlProxyConfiguration.class)
            .modules(new SamlProxyModule())
            .build();
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:18,代码来源:SamlProxyApplication.java

示例3: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<PolicyConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
    bootstrap.addBundle(new IdaJsonProcessingExceptionMapperBundle());
    final InfinispanBundle infinispanBundle = new InfinispanBundle();
    // the infinispan cache manager needs to be lazy loaded because it is not initialized at this point.
    bootstrap.addBundle(infinispanBundle);
    guiceBundle = GuiceBundle.defaultBuilder(PolicyConfiguration.class)
            .modules(getPolicyModule(), bindInfinispan(infinispanBundle.getInfinispanCacheManagerProvider()))
            .build();
    bootstrap.addBundle(guiceBundle);
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:22,代码来源:PolicyApplication.java

示例4: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<SamlEngineConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    MDC.clear();
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
    bootstrap.addBundle(new IdaJsonProcessingExceptionMapperBundle());
    final InfinispanBundle infinispanBundle = new InfinispanBundle();
    bootstrap.addBundle(infinispanBundle);
    guiceBundle = defaultBuilder(SamlEngineConfiguration.class)
            .modules(new SamlEngineModule(), new CryptoModule(), bindInfinispan(infinispanBundle.getInfinispanCacheManagerProvider()))
            .build();
    bootstrap.addBundle(guiceBundle);
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:22,代码来源:SamlEngineApplication.java

示例5: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<SamlSoapProxyConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    bootstrap.addBundle(new IdaJsonProcessingExceptionMapperBundle());
    guiceBundle = defaultBuilder(SamlSoapProxyConfiguration.class)
            .modules(new SamlSoapProxyModule())
            .build();
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:19,代码来源:SamlSoapProxyApplication.java

示例6: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<ConfigConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    guiceBundle = GuiceBundle.defaultBuilder(ConfigConfiguration.class)
            .modules(new ConfigModule())
            .build();
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new ServiceStatusBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new LoggingBundle());
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:18,代码来源:ConfigApplication.java

示例7: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public final void initialize(Bootstrap<MatchingServiceAdapterConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    // Built in Stage.DEVELOPMENT for lazy loading of Singleton objects,
    // this is required as we have Singletons which require the jersey
    // Environment (not available at initialize)
    //
    // See this issue for updates on a lazy Singleton scope
    //
    // https://github.com/google/guice/issues/357
    GuiceBundle<MatchingServiceAdapterConfiguration> guiceBundle = defaultBuilder(MatchingServiceAdapterConfiguration.class)
            .modules(new MatchingServiceAdapterModule())
            .build();
    bootstrap.addBundle(guiceBundle);
    bootstrap.addBundle(new LoggingBundle());
    bootstrap.addBundle(new MonitoringBundle());
    bootstrap.addBundle(new ServiceStatusBundle());
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:25,代码来源:MatchingServiceAdapterApplication.java

示例8: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<ServerConfiguration> bootstrap) {
    bootstrap.addBundle(hibernateBundle);

    bootstrap.addBundle(new AssetsBundle("/swagger-spec", "/api-spec", null));

    bootstrap.addBundle(GuiceBundle.<ServerConfiguration>newBuilder()
        .addModule(new AbstractModule(){
            @Override protected void configure() {}
            @Provides SessionFactory sessionFactoryProvider() { return hibernateBundle.getSessionFactory();}
        })
        .setConfigClass(ServerConfiguration.class)
        .enableAutoConfig(getClass().getPackage().getName())
        .build(Stage.DEVELOPMENT)
    );

    bootstrap.addBundle(new Java8Bundle());

    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
        new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
            new EnvironmentVariableSubstitutor(false)
        )
    );
}
 
开发者ID:gov-ithub,项目名称:StopCozi-api,代码行数:26,代码来源:Server.java

示例9: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<BlockExplorerConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor()
            )
    );
    hyperLedgerBundle = new HyperLedgerBundle<BlockExplorerConfiguration>() {
        @Override
        protected HyperLedgerConfiguration getSupernodeConfiguration(BlockExplorerConfiguration configuration) {
            return configuration.getHyperLedger();
        }
    };
    bootstrap.addBundle(hyperLedgerBundle);
    bootstrap.getObjectMapper().registerModule(new JSR310Module());
}
 
开发者ID:DigitalAssetCom,项目名称:-deprecated-hlp-candidate,代码行数:17,代码来源:BlockExplorerApp.java

示例10: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<AdminUsersConfig> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(NON_STRICT_VARIABLE_SUBSTITUTOR)
            )
    );

    bootstrap.addBundle(new MigrationsBundle<AdminUsersConfig>() {
        @Override
        public DataSourceFactory getDataSourceFactory(AdminUsersConfig configuration) {
            return configuration.getDataSourceFactory();
        }
    });

    bootstrap.addCommand(new DependentResourceWaitCommand());
    bootstrap.addCommand(new MigrateToInitialDbState());
}
 
开发者ID:alphagov,项目名称:pay-adminusers,代码行数:19,代码来源:AdminUsersApp.java

示例11: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {

  bootstrap.setConfigurationSourceProvider(
    new SubstitutingSourceProvider(
      bootstrap.getConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor()
    )
  );

  bootstrap.addCommand(new TestCommand(this,
    Optional.empty(),
    //testDescription(AssetIntegrationTest.class, "newAssetMustHaveId"),
    SmokeTest.class,
    ServerIntegrationTest.class,
    GroupIntegrationTest.class,
    ApplicationIntegrationTest.class,
    AssetIntegrationTest.class,
    SearchIntegrationTest.class
  ));
}
 
开发者ID:atgse,项目名称:sam,代码行数:22,代码来源:Main.java

示例12: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {

  final List<ViewRenderer> renderers = Arrays.asList(new MarkdownViewRenderer(), new HtmlViewRenderer(), new MustacheViewRenderer());
  bootstrap.addBundle(new ViewBundle<SamConfiguration>(renderers));
  bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.mustache", "static"));
  bootstrap.addBundle(new AssetsBundle("/docs", "/docs", "index.html", "docs"));

  bootstrap.setConfigurationSourceProvider(
    new SubstitutingSourceProvider(
      bootstrap.getConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor()
    )
  );

  bootstrap.addCommand(new OAuth2Command());
  bootstrap.addCommand(new CreateDatabaseCommand(this));
  bootstrap.addCommand(new AddTestdataCommand(this));
}
 
开发者ID:atgse,项目名称:sam,代码行数:20,代码来源:Main.java

示例13: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
    public void initialize(Bootstrap<BlockExplorerConfiguration> bootstrap) {
        bootstrap.setConfigurationSourceProvider(
                new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                        new EnvironmentVariableSubstitutor()
                )
        );
        hyperLedgerBundle = new HyperLedgerBundle<BlockExplorerConfiguration>() {
            @Override
            protected HyperLedgerConfiguration getSupernodeConfiguration(BlockExplorerConfiguration configuration) {
                return configuration.getHyperLedger();
//                return configuration.getGRPCConnectedHyperLedger();
            }
        };
        bootstrap.addBundle(hyperLedgerBundle);
        bootstrap.getObjectMapper().registerModule(new JSR310Module());
    }
 
开发者ID:hyperledger-archives,项目名称:fabric-api-archive,代码行数:18,代码来源:BlockExplorerApp.java

示例14: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<?> bootstrap) {
    // Replace variables with values from Consul KV. Please override
    // getConsulAgentHost() and getConsulAgentPort() if Consul is not
    // listening on the default localhost:8500.
    try {
        final Consul consul = Consul.builder().withHostAndPort(HostAndPort
                .fromParts(getConsulAgentHost(), getConsulAgentPort()))
                .build();
        bootstrap.setConfigurationSourceProvider(
                new SubstitutingSourceProvider(
                        bootstrap.getConfigurationSourceProvider(),
                        new ConsulSubstitutor(consul, strict,
                                substitutionInVariables)));
    } catch (ConsulException e) {
        LOGGER.warn(
                "Unable to query Consul running on {}:{},"
                        + " disabling configuration subsitution",
                getConsulAgentHost(), getConsulAgentPort(), e);
    }
}
 
开发者ID:smoketurner,项目名称:dropwizard-consul,代码行数:22,代码来源:ConsulBundle.java

示例15: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<Config> bootstrap) {
    // This allows us to use templating in the YAML configuration.
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(
        bootstrap.getConfigurationSourceProvider(),
        new EnvironmentVariableSubstitutor(false)));

    bootstrap.addBundle(hibernateBundle);
}
 
开发者ID:gchq,项目名称:stroom-stats,代码行数:10,代码来源:App.java


注:本文中的io.dropwizard.setup.Bootstrap.setConfigurationSourceProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。