Java 类io.dropwizard.configuration.EnvironmentVariableSubstitutor 实例源码

项目:verify-hub    文件:StubEventSinkApplication.java   
@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());
}
项目:verify-hub    文件:SamlProxyApplication.java   
@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());
}
项目:verify-hub    文件:PolicyApplication.java   
@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);
}
项目:verify-hub    文件:SamlEngineApplication.java   
@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);
}
项目:verify-hub    文件:SamlSoapProxyApplication.java   
@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());
}
项目:verify-hub    文件:ConfigApplication.java   
@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());
}
项目:verify-service-provider    文件:VerifyServiceProviderConfigurationTest.java   
@Test
public void shouldNotComplainWhenConfiguredCorrectly() throws Exception {
    environmentHelper.setEnv(new HashMap<String, String>() {{
        put("PORT", "50555");
        put("LOG_LEVEL", "ERROR");
        put("VERIFY_ENVIRONMENT", "COMPLIANCE_TOOL");
        put("MSA_METADATA_URL", "some-msa-metadata-url");
        put("MSA_ENTITY_ID", "some-msa-entity-id");
        put("SERVICE_ENTITY_IDS", "[\"http://some-service-entity-id\"]");
        put("SAML_SIGNING_KEY", TEST_RP_PRIVATE_SIGNING_KEY);
        put("SAML_PRIMARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
        put("SAML_SECONDARY_ENCRYPTION_KEY", TEST_RP_PRIVATE_ENCRYPTION_KEY);
        put("CLOCK_SKEW", "PT5s");
    }});

    factory.build(
        new SubstitutingSourceProvider(
            new FileConfigurationSourceProvider(),
            new EnvironmentVariableSubstitutor(false)
        ),
        "verify-service-provider.yml"
    );
}
项目:verify-matching-service-adapter    文件:MatchingServiceAdapterApplication.java   
@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());
}
项目:StopCozi-api    文件:Server.java   
@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)
        )
    );
}
项目:-deprecated-hlp-candidate    文件:BlockExplorerApp.java   
@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());
}
项目:pay-adminusers    文件:AdminUsersApp.java   
@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());
}
项目:openregister-java    文件:RegisterApplication.java   
@Override
public void initialize(Bootstrap<RegisterConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle<>(ImmutableList.of(new ThymeleafViewRenderer("HTML5", "/templates/", ".html", false))));

    if (isRunningOnCloudFoundry()) {
        bootstrap.setConfigurationSourceProvider(new UrlConfigurationSourceProvider());
    }

    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            ));
    bootstrap.addBundle(new AssetsBundle("/assets"));
    bootstrap.addBundle(new CorsBundle());
    bootstrap.addBundle(new LogstashBundle());

    System.setProperty("java.protocol.handler.pkgs", "uk.gov.register.protocols");
}
项目:sam    文件:Main.java   
@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
  ));
}
项目:sam    文件:Main.java   
@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));
}
项目:fabric-api-archive    文件:BlockExplorerApp.java   
@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());
    }
项目:dcos-cassandra-service    文件:ConfigValidatorTest.java   
@Test
public void testName() throws Exception {
  MutableSchedulerConfiguration mutable = factory.build(
    new SubstitutingSourceProvider(
      new FileConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor(false, true)),
    Resources.getResource("scheduler.yml").getFile());
  mutable.getCassandraConfig().getApplication().writeDaemonConfiguration(Paths.get(".").resolve("cassandra.yaml"));
  final ServiceConfig serviceConfig = mutable.getServiceConfig();
  final ServiceConfig updated = ServiceConfig.create("yo",
    serviceConfig.getId(),
    serviceConfig.getVersion(),
    serviceConfig.getUser(),
    serviceConfig.getCluster(),
    serviceConfig.getRole(),
    serviceConfig.getPrincipal(),
    serviceConfig.getFailoverTimeoutS(),
    serviceConfig.getSecret(),
    serviceConfig.isCheckpoint());
  mutable.setServiceConfig(updated);
  final ConfigValidator configValidator = new ConfigValidator();
  final List<ConfigValidationError> validate = configValidator.validate(
    configuration.createConfig(),
    mutable.createConfig());
  Assert.assertTrue(validate.size() == 1);
}
项目:dcos-cassandra-service    文件:ConfigValidatorTest.java   
@Test
public void testCluster() throws Exception {
  MutableSchedulerConfiguration mutable = factory.build(
    new SubstitutingSourceProvider(
      new FileConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor(false, true)),
    Resources.getResource("scheduler.yml").getFile());
  final ServiceConfig serviceConfig = mutable.getServiceConfig();
  final ServiceConfig updated = ServiceConfig.create(serviceConfig.getName(),
    serviceConfig.getId(),
    serviceConfig.getVersion(),
    serviceConfig.getUser(),
    serviceConfig.getCluster() + "1234",
    serviceConfig.getRole(),
    serviceConfig.getPrincipal(),
    serviceConfig.getFailoverTimeoutS(),
    serviceConfig.getSecret(),
    serviceConfig.isCheckpoint());
  mutable.setServiceConfig(updated);
  final ConfigValidator configValidator = new ConfigValidator();
  final List<ConfigValidationError> validate = configValidator.validate(configuration.createConfig(), mutable.createConfig());
  Assert.assertTrue(validate.size() == 1);
}
项目:dcos-cassandra-service    文件:ConfigValidatorTest.java   
@Test
public void testPrincipal() throws Exception {
  MutableSchedulerConfiguration mutable = factory.build(
    new SubstitutingSourceProvider(
      new FileConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor(false, true)),
    Resources.getResource("scheduler.yml").getFile());
  final ServiceConfig serviceConfig = mutable.getServiceConfig();
  final ServiceConfig updated = ServiceConfig.create(serviceConfig.getName(),
    serviceConfig.getId(),
    serviceConfig.getVersion(),
    serviceConfig.getUser(),
    serviceConfig.getCluster(),
    serviceConfig.getRole(),
    serviceConfig.getPrincipal() + "asdf",
    serviceConfig.getFailoverTimeoutS(),
    serviceConfig.getSecret(),
    serviceConfig.isCheckpoint());
  mutable.setServiceConfig(updated);
  final ConfigValidator configValidator = new ConfigValidator();
  final List<ConfigValidationError> validate =
    configValidator.validate(configuration.createConfig(), mutable.createConfig());
  Assert.assertTrue(validate.size() == 1);
}
项目:dcos-cassandra-service    文件:ConfigValidatorTest.java   
@Test
public void testRole() throws Exception {

    MutableSchedulerConfiguration mutable = factory.build(
      new SubstitutingSourceProvider(
        new FileConfigurationSourceProvider(),
        new EnvironmentVariableSubstitutor(false, true)),
      Resources.getResource("scheduler.yml").getFile());
  final ServiceConfig serviceConfig = mutable.getServiceConfig();
  final ServiceConfig updated = ServiceConfig.create(serviceConfig.getName(),
    serviceConfig.getId(),
    serviceConfig.getVersion(),
    serviceConfig.getUser(),
    serviceConfig.getCluster(),
    serviceConfig.getRole() + "qwerty",
    serviceConfig.getPrincipal(),
    serviceConfig.getFailoverTimeoutS(),
    serviceConfig.getSecret(),
    serviceConfig.isCheckpoint());
  mutable.setServiceConfig(updated);
  final ConfigValidator configValidator = new ConfigValidator();
  final List<ConfigValidationError> validate = configValidator.validate(configuration.createConfig(),mutable.createConfig());
  Assert.assertTrue(validate.size() == 1);
}
项目:WebCrawler    文件:WebApp.java   
@Override
public void initialize(Bootstrap<AppConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor()
            )
    );

    /* Configure objectMapper to instantiate immutable configuration correctly */
    ObjectMapper objectMapper = bootstrap.getObjectMapper();
    objectMapper.registerModule(new JSR310Module());
    bootstrap.getObjectMapper()
            .setVisibilityChecker(objectMapper.getSerializationConfig().getDefaultVisibilityChecker()
                    .withFieldVisibility(JsonAutoDetect.Visibility.ANY)
                    .withGetterVisibility(JsonAutoDetect.Visibility.NONE)
                    .withSetterVisibility(JsonAutoDetect.Visibility.NONE)
                    .withCreatorVisibility(JsonAutoDetect.Visibility.NONE));

    /* Host static resources */
    bootstrap.addBundle((new AssetsBundle("/assets", "/", "index.html", "static")));

    /* Enable WebSockets support */
    bootstrap.addBundle(websocketBundle = new WebsocketBundle<>());
}
项目:fabric-api    文件:BlockExplorerApp.java   
@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());
    }
项目:pay-publicauth    文件:PublicAuthApp.java   
@Override
public void initialize(Bootstrap<PublicAuthConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    bootstrap.addBundle(new DBIExceptionsBundle());

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

    bootstrap.addCommand(new DependentResourceWaitCommand());
}
项目:microservice-bundle    文件:µService.java   
@Override
public void initialize(Bootstrap<C> bootstrap) {
  bootstrap.setConfigurationSourceProvider(
      new SubstitutingSourceProvider(new ResourceConfigurationSourceProvider(),
          new EnvironmentVariableSubstitutor(false))
  );
  µsBundle.Builder<C> µsBundleBuilder = µsBundle.<C>newBuilder();
  initialize(µsBundleBuilder);
  µsBundleInstance = µsBundleBuilder.setConfigClass(getConfigurationClass()).addGuiceLifecycleListener(this).build();
  bootstrap.addBundle(µsBundleInstance);
  if (ZipkinAware.class.isAssignableFrom(getConfigurationClass())) {
    logger.info("Register " + ZipkinBundle.class.getSimpleName() + " ...");
    bootstrap.addBundle(new ZipkinBundle<C>(getName()) {
      @Override
      public ZipkinFactory getZipkinFactory(C c) {
        return ((ZipkinAware)c).getZipkin();
      }
    });
  }
}
项目:dropwizard-kubernetes    文件:DropWizardk8s2Application.java   
@Override
public void initialize(final Bootstrap<DropWizardk8s2Configuration> bootstrap) {


    System.out.println("================Environment==============");
    System.out.println(System.getenv());

    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor()
            )
    );

    // TODO: application initialization
}
项目:dropwizard-kubernetes    文件:DropWizardK8S1Application.java   
@Override
public void initialize(final Bootstrap<DropWizardK8S1Configuration> bootstrap) {


    System.out.println("================Environment==============");
    System.out.println(System.getenv());

    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    // TODO: application initialization
}
项目:zucchini-ui    文件:BackendBundle.java   
@Override
public void initialize(final Bootstrap<?> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(
        bootstrap.getConfigurationSourceProvider(),
        new EnvironmentVariableSubstitutor(false)
    ));

    // Configure Jackson mapper
    bootstrap.getObjectMapper()
        .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
        .setSerializationInclusion(JsonInclude.Include.NON_NULL);

    // Enable WebSockets for Jetty
    bootstrap.addBundle(new WebSocketEnablerBundle());

    // Register Spring context
    applicationContext.register(BackendSpringConfig.class);
    bootstrap.addBundle(new SpringBundle(applicationContext));
}
项目:budgetapp    文件:BudgetApplication.java   
@Override
public void initialize(Bootstrap<AppConfiguration> bootstrap) {
    MigrationsBundle<AppConfiguration> migrationBundle = new MigrationsBundle<AppConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(AppConfiguration configuration) {
            return configuration.getDataSourceFactory();
        }
    };

    // allow using Environment variable in yaml
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(
                    bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    bootstrap.addBundle(migrationBundle);
    bootstrap.addBundle(hibernate);
    bootstrap.addBundle(new ConfiguredAssetsBundle("/app", "/app", "index.html"));
}
项目:CredentialStorageService    文件:CredentialStorageApplication.java   
@Override
public void initialize(final Bootstrap<CredentialStorageConfiguration> bootstrap) {
    bootstrap.addBundle(this.circuitBreakerBundle);
    bootstrap.addBundle(this.petite);
    bootstrap.addBundle(this.adminResourceBundle);
    bootstrap.addBundle(new SwaggerBundle<CredentialStorageConfiguration>() {
        @Override
        protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(
                final CredentialStorageConfiguration configuration) {
            return configuration.getSwaggerBundleConfiguration();
        }
    });
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)));
}
项目:timbuctoo    文件:TimbuctooV4.java   
@Override
public void initialize(Bootstrap<TimbuctooConfiguration> bootstrap) {
  //bundles
  activeMqBundle = new ActiveMQBundle();
  bootstrap.addBundle(activeMqBundle);
  bootstrap.addBundle(new MultiPartBundle());
  bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.html"));
  /*
   * Make it possible to use environment variables in the config.
   * see: http://www.dropwizard.io/0.9.1/docs/manual/core.html#environment-variables
   */
  bootstrap.setConfigurationSourceProvider(
    new SubstitutingSourceProvider(
      bootstrap.getConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor(true)
    ));
}
项目:stroom-stats    文件:App.java   
@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);
}
项目:stroom-stats    文件:HeadlessTestApp.java   
@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);
}
项目:outland    文件:ServerMain.java   
@Override
public void initialize(Bootstrap<ServerConfiguration> bootstrap) {
  final boolean strict = false;
  bootstrap.setConfigurationSourceProvider(
      new SubstitutingSourceProvider(
          bootstrap.getConfigurationSourceProvider(),
          new EnvironmentVariableSubstitutor(strict)));
  bootstrap.addBundle(new Java8Bundle());
  bootstrap.addBundle(new Protobuf3Bundle());
  super.initialize(bootstrap);
}
项目:dropwizard-hikaricp-benchmark    文件:BenchApplication.java   
@Override
public void initialize(final Bootstrap<BenchConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(true)
            )
    );
}
项目:verify-service-provider    文件:VerifyServiceProviderApplication.java   
@Override
public void initialize(Bootstrap<VerifyServiceProviderConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
        new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
            new EnvironmentVariableSubstitutor(false)
        )
    );
    IdaSamlBootstrap.bootstrap();
    bootstrap.getObjectMapper().setDateFormat(ISO8601DateFormat.getInstance());
}
项目:graphiak    文件:GraphiakApplication.java   
@Override
public void initialize(final Bootstrap<GraphiakConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(
            bootstrap.getConfigurationSourceProvider(),
            new EnvironmentVariableSubstitutor(false)));

    bootstrap.addBundle(new RiakBundle<GraphiakConfiguration>() {
        @Override
        public RiakFactory getRiakFactory(
                GraphiakConfiguration configuration) {
            return configuration.getRiak();
        }
    });
}
项目:KeyStor    文件:EncryptionServiceApplication.java   
/**
 *
 * @param bootstrap The pre-start application environment, containing everything required to bootstrap a Dropwizard command.
 *                  It wires up everything being used in the Environment, including the Configuration and the Application
 */
@Override
public void initialize(Bootstrap<EncryptionServiceConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(
                    bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    bootstrap.addBundle(new AssetsBundle());
}
项目:KeyStor    文件:ConnectionServiceApplication.java   
/**
 *
 * @param bootstrap The pre-start application environment, containing everything required to bootstrap a Dropwizard command.
 *                  It wires up everything being used in the Environment, including the Configuration and the Application
 */
@Override
public void initialize(Bootstrap<ConnectionServiceConfiguration> bootstrap) {
    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(
                    bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );

    bootstrap.addBundle(new AssetsBundle());
}
项目:kafka-rest    文件:DemoApplication.java   
@Override
public void initialize(Bootstrap<DemoConfiguration> bootstrap) {
  bootstrap.addBundle(new AssetsBundle("/assets/index.html", "/"));
  bootstrap.setConfigurationSourceProvider(
          new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                  new EnvironmentVariableSubstitutor()
          )
  );
}
项目:dcos-cassandra-service    文件:ConfigValidatorTest.java   
@Before
public void beforeEach() throws Exception {
  factory = new ConfigurationFactory<>(
    MutableSchedulerConfiguration.class,
    BaseValidator.newValidator(),
    Jackson.newObjectMapper().registerModule(new GuavaModule())
      .registerModule(new Jdk8Module()),
    "dw");

  configuration = factory.build(
    new SubstitutingSourceProvider(
      new FileConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor(false, true)),
    Resources.getResource("scheduler.yml").getFile());
}
项目:pay-cardid    文件:CardApi.java   
@Override
public void initialize(Bootstrap<CardConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(
                    bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            )
    );
}