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


Java Bootstrap.addBundle方法代码示例

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


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

示例1: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(final Bootstrap<EndpointConfiguration> bootstrap) {
  bootstrap.getObjectMapper().configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);

  bootstrap.addBundle(new SwaggerBundle<EndpointConfiguration>() {
    @Override
    protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(
        EndpointConfiguration configuration) {
      return configuration.swagger;
    }
  });
}
 
开发者ID:nblair,项目名称:continuous-performance-testing,代码行数:13,代码来源:EndpointApplication.java

示例2: 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

示例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 void initialize(Bootstrap<SECPConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/assets/app/", "/", "index.html"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/login", "index.html", "login"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/login/authenticate", "index.html", "authenticate"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/login/forgot-password", "index.html", "forgot-password"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/chats", "index.html", "chats"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal", "index.html", "portal"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/user-profile", "index.html", "user-profile"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/user-profile/change-password", "index.html", "change-password"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/group-profile", "index.html", "group-profile"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/audit", "index.html", "audit"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/audit/user", "index.html", "audit-user"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/audit/group", "index.html", "audit-group"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/manage", "index.html", "manage"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/manage/user", "index.html", "manage-user"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/manage/group", "index.html", "manage-group"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/configure", "index.html", "configure"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/configure/filter", "index.html", "tags"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/configure/tags", "index.html", "filter"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/error/404", "index.html", "404"));

    bootstrap.addBundle(hibernateBundle);
    ObjectMapper mapper = bootstrap.getObjectMapper();
    mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
}
 
开发者ID:tosinoni,项目名称:SECP,代码行数:27,代码来源:SECPService.java

示例8: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<DropwizardConfiguration> bootstrap) {
	guiceBundle = GuiceBundle.<DropwizardConfiguration>newBuilder()
			.addModule(new AbstractModule() {

				@Provides
				public MongoManaged mongoManaged(DropwizardConfiguration configuration) throws Exception {
					return new MongoManaged(configuration.mongo);
				}

				@Override
				protected void configure() {
					bind(ProjectRepository.class);
					bind(TaskRepository.class);
					bind(TaskToProjectRepository.class);
				}

			})
			.setConfigClass(DropwizardConfiguration.class)
			.build();

	bootstrap.addBundle(guiceBundle);
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:24,代码来源:DropwizardService.java

示例9: 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

示例10: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<BitShadowConfiguration> bootstrap) {
    bootstrap.addBundle(GuiceBundle.builder()
            .modules(new BitShadowWebModule())
            .build()
    );
    bootstrap.addBundle(new SwaggerBundle<BitShadowConfiguration>() {
        @Override
        protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(BitShadowConfiguration configuration) {
            return configuration.swaggerBundleConfiguration;
        }
    });

    bootstrap.getObjectMapper()
            .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
            .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
            .setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE)
            .setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
            .findAndRegisterModules();
}
 
开发者ID:LittleMikeDev,项目名称:bitshadow,代码行数:21,代码来源:BitShadowWebService.java

示例11: testGetImplementingBundles

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testGetImplementingBundles() {
    Bootstrap<?>     bootstrap     = new Bootstrap<>(null);
    ConfiguredBundle hashSetBundle = (ConfiguredBundle) mock(HashSet.class, withSettings().extraInterfaces(ConfiguredBundle.class).defaultAnswer(RETURNS_DEEP_STUBS));
    ConfiguredBundle hashMapBundle = (ConfiguredBundle) mock(HashMap.class, withSettings().extraInterfaces(ConfiguredBundle.class).defaultAnswer(RETURNS_DEEP_STUBS));
    Bundle           treeSetBundle = (Bundle) mock(TreeSet.class, withSettings().extraInterfaces(Bundle.class).defaultAnswer(RETURNS_DEEP_STUBS));
    Bundle           treeMapBundle = (Bundle) mock(TreeMap.class, withSettings().extraInterfaces(Bundle.class).defaultAnswer(RETURNS_DEEP_STUBS));
    bootstrap.addBundle(hashMapBundle);
    bootstrap.addBundle(hashSetBundle);
    bootstrap.addBundle(treeMapBundle);
    bootstrap.addBundle(treeSetBundle);
    //
    List<Set> setBundles = BootstrapExtensions.getImplementingBundles(bootstrap, Set.class);
    List<Map> mapBundles = BootstrapExtensions.getImplementingBundles(bootstrap, Map.class);
    //
    assertThat(setBundles).isNotNull();
    assertThat(setBundles).containsExactlyInAnyOrder((Set) hashSetBundle, (Set) treeSetBundle);
    assertThat(mapBundles).isNotNull();
    assertThat(mapBundles).containsExactlyInAnyOrder((Map) hashMapBundle, (Map) treeMapBundle);
}
 
开发者ID:baharclerode,项目名称:dropwizard-hk2,代码行数:22,代码来源:BootstrapExtensionsTest.java

示例12: initialize

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

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

    bootstrap.addBundle(new AssetsBundle("/com/cloudwise/sap/niping/view/static", "/static", null, "static"));
    bootstrap.addBundle(new AssetsBundle("/com/cloudwise/sap/niping/view/vendor", "/vendor", null, "vendor"));
    bootstrap.addBundle(new ViewBundle<ServerConfiguration>());
}
 
开发者ID:CloudWise-OpenSource,项目名称:SAPNetworkMonitor,代码行数:15,代码来源:NiPingMonitorApplication.java

示例13: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<HelloWorldConfiguration> bootstrap) {
    bootstrap.addBundle(
            new AtomixBundle<HelloWorldConfiguration>(getName()) {
                @Override
                public AtomixFactory getAtomixFactory(
                        HelloWorldConfiguration configuration) {
                    return configuration.getAtomix();
                }
            });
}
 
开发者ID:smoketurner,项目名称:dropwizard-atomix,代码行数:12,代码来源:HelloWorldApplication.java

示例14: 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

示例15: initialize

import io.dropwizard.setup.Bootstrap; //导入方法依赖的package包/类
@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);
}
 
开发者ID:dehora,项目名称:outland,代码行数:12,代码来源:ServerMain.java


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