本文整理汇总了Java中ratpack.launch.LaunchConfig类的典型用法代码示例。如果您正苦于以下问题:Java LaunchConfig类的具体用法?Java LaunchConfig怎么用?Java LaunchConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LaunchConfig类属于ratpack.launch包,在下文中一共展示了LaunchConfig类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromLaunchConfigBuilder
import ratpack.launch.LaunchConfig; //导入依赖的package包/类
/**
* Creates an embedded application by building a {@link LaunchConfig}.
* <p>
* The given {@link LaunchConfigBuilder} will be configured to not have base dir, and to use an ephemeral port.
*
* @param function a function that builds a launch config from a launch config builder
* @return a newly created embedded application
*/
static EmbeddedApp fromLaunchConfigBuilder(Function<? super LaunchConfigBuilder, ? extends LaunchConfig> function) {
return new LaunchConfigEmbeddedApp() {
@Override
protected LaunchConfig createLaunchConfig() {
return uncheck(() -> function.apply(LaunchConfigBuilder.noBaseDir().development(true).port(0)));
}
};
}
示例2: build
import ratpack.launch.LaunchConfig; //导入依赖的package包/类
public static EmbeddedApp build(@DelegatesTo(value = Spec.class, strategy = Closure.DELEGATE_FIRST) Closure<?> closure) {
return new LaunchConfigEmbeddedApp() {
@Override
protected LaunchConfig createLaunchConfig() {
final SpecWrapper spec = new SpecWrapper();
configureDelegateFirst(spec.getSpec(), closure);
LaunchConfigBuilder launchConfigBuilder;
if (spec.baseDirSupplier != null) {
Path baseDirPath = spec.baseDirSupplier.get();
launchConfigBuilder = LaunchConfigBuilder.baseDir(baseDirPath);
} else {
launchConfigBuilder = LaunchConfigBuilder.noBaseDir();
}
configureDelegateFirst(launchConfigBuilder.port(0), spec.launchConfig);
final Action<? super BindingsSpec> bindingsAction = bindingsSpec -> configureDelegateFirst(new DefaultGroovyBindingsSpec(bindingsSpec), spec.bindings);
return launchConfigBuilder.build(launchConfig -> {
Guice.Builder builder = Guice.builder(launchConfig);
if (spec.parentInjector != null) {
builder.parent(spec.parentInjector);
}
return builder.bindings(bindingsAction).build(chain -> Groovy.chain(chain, spec.handlers));
});
}
};
}
示例3: createServer
import ratpack.launch.LaunchConfig; //导入依赖的package包/类
@Override
protected RatpackServer createServer() {
LaunchConfig launchConfig = createLaunchConfig();
return RatpackServerBuilder.build(launchConfig);
}
示例4: createLaunchConfig
import ratpack.launch.LaunchConfig; //导入依赖的package包/类
abstract protected LaunchConfig createLaunchConfig();