ro.pippo.core.Response.noCache()方法的使用及代码示例

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

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

Response.noCache介绍

[英]Sets this response as not cacheable.
[中]将此响应设置为不可缓存。

代码示例

代码示例来源:origin: pippo-java/pippo

/**
 * Specify Response cache controls.
 *
 * @param routeContext
 */
protected void specifyCacheControls(RouteContext routeContext) {
  if (isNoCache) {
    log.debug("NoCache detected, response may not be cached");
    routeContext.getResponse().noCache();
  }
}

代码示例来源:origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  Map<String, String> props = new HashMap<>();
  for (String name : System.getProperties().stringPropertyNames()) {
    props.put(name, System.getProperty(name));
  }
  try (BufferedWriter writer = new BufferedWriter(response.getWriter())) {
    writeSystemProperties(props, writer);
    writer.newLine();
    writeEnv(System.getenv(), writer);
    writer.flush();
  } catch (IOException e) {
    log.error(e.getMessage(), e);
  }
}

代码示例来源:origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  Map<String, String> settingsMap = settingsToMap(routeContext.getSettings());
  Response response = routeContext.getResponse().noCache().text();
  try (BufferedWriter writer = new BufferedWriter(response.getWriter())) {
    writeSettings(settingsMap, writer);
    writer.flush();
  } catch (IOException e) {
    log.error(e.getMessage(), e);
  }
}

代码示例来源:origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  routeContext.getResponse().noCache().text().send("pong");
}

代码示例来源:origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();

代码示例来源:origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  SortedMap<String, HealthCheck.Result> healthChecks = healthCheckRegistry.runHealthChecks();
  if (healthChecks.isEmpty()) {
    response.notImplemented().send("The health checks are empty");
  } else {
    boolean notHealthy = healthChecks.values().stream().anyMatch(hc -> !hc.isHealthy());
    if (notHealthy) {
      response.internalError().send("The health is bad");
    } else {
      response.ok().send("The health is good");
    }
  }
}

代码示例来源:origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  if (threadDump != null) {
    threadDump.dump(response.getOutputStream());
  } else {
    response.internalError().send("Sorry your runtime environment does not allow to dump threads");
  }
}

代码示例来源:origin: ro.pippo/pippo-controller

/**
 * Specify Response cache controls.
 *
 * @param routeContext
 */
protected void specifyCacheControls(RouteContext routeContext) {
  if (isNoCache) {
    log.debug("NoCache detected, response may not be cached");
    routeContext.getResponse().noCache();
  }
}

代码示例来源:origin: com.gitblit.fathom/fathom-rest

/**
 * Specify Response cache controls.
 *
 * @param context
 */
protected void specifyCacheControls(Context context) {
  if (isNoCache) {
    log.debug("NoCache detected, response may not be cached");
    context.getResponse().noCache();
  }
}

代码示例来源:origin: gitblit/fathom

/**
 * Specify Response cache controls.
 *
 * @param context
 */
protected void specifyCacheControls(Context context) {
  if (isNoCache) {
    log.debug("NoCache detected, response may not be cached");
    context.getResponse().noCache();
  }
}

代码示例来源:origin: ro.pippo/pippo-metrics

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();

代码示例来源:origin: ro.pippo/pippo-metrics

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  SortedMap<String, HealthCheck.Result> healthChecks = healthCheckRegistry.runHealthChecks();
  if (healthChecks.isEmpty()) {
    response.notImplemented().send("The health checks are empty");
  } else {
    boolean notHealthy = healthChecks.values().stream().anyMatch(hc -> !hc.isHealthy());
    if (notHealthy) {
      response.internalError().send("The health is bad");
    } else {
      response.ok().send("The health is good");
    }
  }
}

代码示例来源:origin: ro.pippo/pippo-metrics

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  if (threadDump != null) {
    threadDump.dump(response.getOutputStream());
  } else {
    response.internalError().send("Sorry your runtime environment does not allow to dump threads");
  }
}

相关文章