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


Java Configuration类代码示例

本文整理汇总了Java中com.yammer.dropwizard.config.Configuration的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: run

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override public void run(Configuration config, Environment environment) {
  // Suppress the "THIS SERVICE HAS NO HEALTHCHECKS" warning.
  // A real service would have proper health checks.
  environment.addHealthCheck(new FakeHealthCheck());

  // Suppress the "ResourceConfig instance does not contain any root resource classes" error.
  // A real service would probably provide a Jersey resource or two.
  environment.addResource(EmptyResource.class);

  // Here's the interesting part:
  // Mount the Rack application defined in the config.ru file on the classpath at /rack.
  environment.addServlet(createRackServlet(), "/rack/*");
}
 
开发者ID:square,项目名称:rack-servlet,代码行数:14,代码来源:ExampleService.java

示例2: createCommand

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Before
public void createCommand(){
    runScriptCommand = new RunScriptCommand<Configuration>("run", "desc", null, Configuration.class);
    dbdeploy = mock(ClasspathDbDeploy.class);
    namespace = mock(Namespace.class);
    config = mock(DbDeployDatabaseConfiguration.class);
    
}
 
开发者ID:plasma147,项目名称:dropwizard-dbdeploy,代码行数:9,代码来源:RunScriptCommandTest.java

示例3: initialize

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<Configuration> bootstrap) {
    bootstrap.setName("pizza-application");
}
 
开发者ID:bazaarvoice,项目名称:jersey-hmac-auth,代码行数:5,代码来源:PizzaService.java

示例4: run

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override
public void run(Configuration configuration, Environment environment) throws Exception {
    environment.addResource(new PizzaResource());
    environment.addHealthCheck(new PizzaHealthCheck());
    environment.addProvider(new HmacAuthProvider<>(new DefaultRequestHandler<>(new PizzaAuthenticator())));
}
 
开发者ID:bazaarvoice,项目名称:jersey-hmac-auth,代码行数:7,代码来源:PizzaService.java

示例5: getConfiguration

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override
public Configuration getConfiguration() {
	return this.config;
}
 
开发者ID:mongodb-labs,项目名称:hvdf,代码行数:5,代码来源:DefaultChannelService.java

示例6: getConfiguration

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override
public Configuration getConfiguration() {
    return this.config;
}
 
开发者ID:mongodb-labs,项目名称:hvdf,代码行数:5,代码来源:DefaultAsyncService.java

示例7: initialize

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override public void initialize(Bootstrap<Configuration> bootstrap) {
  // Nothing to do here.
}
 
开发者ID:square,项目名称:rack-servlet,代码行数:4,代码来源:ExampleService.java

示例8: build

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
public <CT extends Configuration> GuiceBundle<CT> build(){
    return new GuiceBundle<CT>(modules(), injector());
}
 
开发者ID:fizmo,项目名称:dropwizard-bundle-guice,代码行数:4,代码来源:GuiceBundle.java

示例9: SpyEnv

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
private SpyEnv(String name, Configuration configuration, ObjectMapperFactory objectMapperFactory, Validator validator) {
  super(name, configuration, objectMapperFactory, validator);
}
 
开发者ID:wrightmikea,项目名称:pluot,代码行数:4,代码来源:EmbeddableServiceTest.java

示例10: initialize

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
public void initialize(Bootstrap<?> bootstrap) {
    final Class<T> klass = Generics.getTypeParameter(getClass(), Configuration.class);
    bootstrap.addCommand(new MainDbDeployCommand<T>(this, klass, commandName));
}
 
开发者ID:plasma147,项目名称:dropwizard-dbdeploy,代码行数:5,代码来源:DbDeployBundle.java

示例11: getConfiguration

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
/**
 * Get the configuration for this service
 * @return the configuration object specific to the service implementation
 */
public Configuration getConfiguration();
 
开发者ID:mongodb-labs,项目名称:hvdf,代码行数:6,代码来源:Service.java

示例12: getConfigurationClass

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
/**
 * Retrieve the configuration class.
 *
 * @return the configuration class.
 */
protected Class<T> getConfigurationClass() {
    return Generics.getTypeParameter(getClass(), Configuration.class);
}
 
开发者ID:twilio,项目名称:wiztowar,代码行数:9,代码来源:DWAdapter.java

示例13:

import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
/**
 *
 * @param testClass the class of the test
 * @param serviceUnderTest an instance of {@link com.yammer.dropwizard.Service} under test. As explained in the documentation for
 * {@link LifecycleService#LifecycleService(com.yammer.dropwizard.Service)} the {@link com.yammer.dropwizard.Service#run(String[])} method should not
 *                         have been executed.
 * @param configFile the path to the config file
 * @param additionalFiles filenames of additional files to be available at the same path as the server run directory. They are expected to be found in
 *                        the resources for the class under test.
 * @param <T>
 * @param <S>
 * @return
 * @throws Exception
 */
public static <T extends Configuration, S extends Service<T>> TestServer<T, S>
create(Class<?> testClass, S serviceUnderTest, final String configFile, String... additionalFiles) throws Exception {
    return new TestServer<>(testClass, new LifecycleService<>(serviceUnderTest), configFile, additionalFiles);
}
 
开发者ID:yammer,项目名称:dropwizard-testing-integration,代码行数:19,代码来源:TestServer.java


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