spark.Spark.afterAfter()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(289)

本文整理了Java中spark.Spark.afterAfter()方法的一些代码示例,展示了Spark.afterAfter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spark.afterAfter()方法的具体详情如下:
包路径:spark.Spark
类名称:Spark
方法名:afterAfter

Spark.afterAfter介绍

[英]Execute after route even if the route throws exception
[中]即使路由引发异常,也要在路由之后执行

代码示例

代码示例来源:origin: gocd/gocd

public void init() {
  before("/*", (request, response) -> request.attribute(TIMER_START, new RuntimeHeaderEmitter(request, response)));
  before("/*", (request, response) -> response.header("Cache-Control", "max-age=0, private, must-revalidate"));
  controllers.forEach(SparkSpringController::setupRoutes);
  sparkControllers.forEach(SparkController::setupRoutes);
  exception(JsonParseException.class, this::invalidJsonPayload);
  exception(UnprocessableEntityException.class, this::unprocessableEntity);
  afterAfter("/*", (request, response) -> request.<RuntimeHeaderEmitter>attribute(TIMER_START).render());
}

代码示例来源:origin: openzipkin/brave

@Override
 public void init() {
  Spark.before(sparkTracing.before());
  Spark.get("/unsampled", (Request request, Response response) -> "hello world");
  Spark.afterAfter(sparkTracing.afterAfter());
 }
}

代码示例来源:origin: openzipkin/brave

@Override
 public void init() {
  Spark.before(sparkTracing.before());
  Spark.get("/traced", (Request request, Response response) -> "hello world");
  Spark.afterAfter(sparkTracing.afterAfter());
 }
}

代码示例来源:origin: openzipkin/brave

@Override
 public void init() {
  Spark.before(sparkTracing.before());
  Spark.get("/traced128", (Request request, Response response) -> "hello world");
  Spark.afterAfter(sparkTracing.afterAfter());
 }
}

代码示例来源:origin: openzipkin/brave

@Override
 public void init() {
  Spark.before(sparkTracing.before());
  Spark.get("/tracedextra", (Request request, Response response) -> {
   ExtraFieldPropagation.set("country-code", "FO");
   return "hello world";
  });
  Spark.afterAfter(sparkTracing.afterAfter());
 }
}

代码示例来源:origin: manifold-systems/manifold

public static void init()
{
 before( (request, response) -> {
  REQUEST.set( request );
  RESPONSE.set( response );
 } );
 afterAfter( (request, response) -> {
  REQUEST.set( null );
  RESPONSE.set( null );
 } );
}

代码示例来源:origin: systems.manifold/manifold-templates

public static void init()
{
 before( (request, response) -> {
  REQUEST.set( request );
  RESPONSE.set( response );
 } );
 afterAfter( (request, response) -> {
  REQUEST.set( null );
  RESPONSE.set( null );
 } );
}

代码示例来源:origin: mgtechsoftware/smockin

});
Spark.afterAfter((request, response) -> {

相关文章