当前位置: 首页>>代码示例>>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;未经允许,请勿转载。