當前位置: 首頁>>代碼示例>>Java>>正文


Java LaunchConfig類代碼示例

本文整理匯總了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)));
        }
    };
}
 
開發者ID:jprante,項目名稱:elasticsearch-plugin-ratpack,代碼行數:17,代碼來源:EmbeddedApp.java

示例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));
                });
            }
        };
    }
 
開發者ID:jprante,項目名稱:elasticsearch-plugin-ratpack,代碼行數:33,代碼來源:GroovyEmbeddedApp.java

示例3: createServer

import ratpack.launch.LaunchConfig; //導入依賴的package包/類
@Override
protected RatpackServer createServer() {
    LaunchConfig launchConfig = createLaunchConfig();
    return RatpackServerBuilder.build(launchConfig);
}
 
開發者ID:jprante,項目名稱:elasticsearch-plugin-ratpack,代碼行數:6,代碼來源:LaunchConfigEmbeddedApp.java

示例4: createLaunchConfig

import ratpack.launch.LaunchConfig; //導入依賴的package包/類
abstract protected LaunchConfig createLaunchConfig(); 
開發者ID:jprante,項目名稱:elasticsearch-plugin-ratpack,代碼行數:2,代碼來源:LaunchConfigEmbeddedApp.java


注:本文中的ratpack.launch.LaunchConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。