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


Java Routes類代碼示例

本文整理匯總了Java中spark.route.Routes的典型用法代碼示例。如果您正苦於以下問題:Java Routes類的具體用法?Java Routes怎麽用?Java Routes使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Routes類屬於spark.route包,在下文中一共展示了Routes類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: destroy

import spark.route.Routes; //導入依賴的package包/類
@Override
public void destroy() {
    //hacky way to reset the state of the routes between tests
    //see Service.stop(), (not invoked directly because it spawns a thread)
    try {
        Method getInstance = Spark.class.getDeclaredMethod("getInstance");
        getInstance.setAccessible(true);
        Service service = (Service) getInstance.invoke(null);
        //Dependent on current version of Spark
        //This is likely to fail in case of upgrades
        clear(service, "routes", Routes.class);
        clear(service, "exceptionMapper", ExceptionMapper.class);
        clear(service, "staticFilesConfiguration", StaticFilesConfiguration.class);
        ReflectionTestUtils.setField(service, "initialized", false);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:gocd,項目名稱:gocd,代碼行數:19,代碼來源:TestApplication.java

示例2: create

import spark.route.Routes; //導入依賴的package包/類
@Override
public EmbeddedServer create(Routes routes, StaticFilesConfiguration staticFilesConfiguration, boolean multipleHandlers) {
    if (embeddedServer == null) {
        embeddedServer = new LambdaEmbeddedServer(routes, staticFilesConfiguration, multipleHandlers);
    }

    return embeddedServer;
}
 
開發者ID:awslabs,項目名稱:aws-serverless-java-container,代碼行數:9,代碼來源:LambdaEmbeddedServerFactory.java

示例3: LambdaEmbeddedServer

import spark.route.Routes; //導入依賴的package包/類
LambdaEmbeddedServer(Routes routes, StaticFilesConfiguration filesConfig, boolean multipleHandlers) {
    applicationRoutes = routes;
    staticFilesConfiguration = filesConfig;
    hasMultipleHandler = multipleHandlers;

    // try to initialize the filter here.
    sparkFilter = new MatcherFilter(applicationRoutes, staticFilesConfiguration, true, hasMultipleHandler);
}
 
開發者ID:awslabs,項目名稱:aws-serverless-java-container,代碼行數:9,代碼來源:LambdaEmbeddedServer.java


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