本文整理汇总了Java中com.yammer.dropwizard.Service类的典型用法代码示例。如果您正苦于以下问题:Java Service类的具体用法?Java Service怎么用?Java Service使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Service类属于com.yammer.dropwizard包,在下文中一共展示了Service类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LifecycleServerCommand
import com.yammer.dropwizard.Service; //导入依赖的package包/类
public LifecycleServerCommand(Service<T> service, Class<T> configurationClass) {
super(service, COMMAND_LINE_NAME, "Test version of the server command, which enables server shutdown.");
this.configurationClass = configurationClass;
}
示例2: EmbeddedServerCommand
import com.yammer.dropwizard.Service; //导入依赖的package包/类
public EmbeddedServerCommand(Service<T> service) {
super(service, "embedded-server", "Starts an HTTP server for running within a larger application");
this.configurationClass = service.getConfigurationClass();
}
示例3: getSingletonService
import com.yammer.dropwizard.Service; //导入依赖的package包/类
/**
* Override to provide your particular Dropwizard Service.
*
* @return your {@link Service}
*/
public abstract Service getSingletonService();
示例4: create
import com.yammer.dropwizard.Service; //导入依赖的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);
}
示例5: getDelegate
import com.yammer.dropwizard.Service; //导入依赖的package包/类
protected abstract Service<C> getDelegate();