本文整理汇总了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/*");
}
示例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);
}
示例3: initialize
import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<Configuration> bootstrap) {
bootstrap.setName("pizza-application");
}
示例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())));
}
示例5: getConfiguration
import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override
public Configuration getConfiguration() {
return this.config;
}
示例6: getConfiguration
import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override
public Configuration getConfiguration() {
return this.config;
}
示例7: initialize
import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
@Override public void initialize(Bootstrap<Configuration> bootstrap) {
// Nothing to do here.
}
示例8: build
import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
public <CT extends Configuration> GuiceBundle<CT> build(){
return new GuiceBundle<CT>(modules(), injector());
}
示例9: SpyEnv
import com.yammer.dropwizard.config.Configuration; //导入依赖的package包/类
private SpyEnv(String name, Configuration configuration, ObjectMapperFactory objectMapperFactory, Validator validator) {
super(name, configuration, objectMapperFactory, validator);
}
示例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));
}
示例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();
示例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);
}
示例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);
}