现在的位置: 首页 > 综合 > 正文

javax.servlet Class UnavailableException

2013年08月22日 ⁄ 综合 ⁄ 共 2644字 ⁄ 字号 评论关闭

 

public class UnavailableException
extends ServletException

Defines an exception that a servlet or filter throws to indicate that it is permanently or temporarily unavailable. 定义了一种异常,servlet或过滤器抛出表示其永久或暂时不可用。

When a servlet or filter is permanently unavailable, something is wrong with it, and it cannot handle requests until some action is taken. For example, a servlet might be configured incorrectly, or a filter's state may be corrupted. The component should log both the error and the corrective action that is needed. 当servlet或过滤器永久不可用时,说明有错,除非采取措施否则不能处理请求。比如,servlet没有配置正确,或者过滤器的状态被误用。组件应该将错误和需要的采取的正确错误记入日志。

A servlet or filter is temporarily unavailable if it cannot handle requests momentarily due to some system-wide problem. For example, a third-tier server might not be accessible, or there may be insufficient memory or disk storage to handle requests. A system administrator may need to take corrective action. 如果sevlet或过滤器因为某些系统问题不能即时处理请求,则其为暂时不可用。比如,三层服务器可能不能被访问,或者内存或磁盘空间不够不足以处理请求。系统管理员可以采取纠正措施。

Servlet containers can safely treat both types of unavailable exceptions in the same way. However, treating temporary unavailability effectively makes the servlet container more robust. Specifically, the servlet container might block requests to the servlet or filter for a period of time suggested by the exception, rather than rejecting them until the servlet container restarts. servlet容器可以以相同的方式安全地处理两种类型的不可用。然而,有效地处理暂时不可用 将使servlet容器更可靠。特别地,servlet容器可以将向servlet或过滤器发出的请求阻塞一段异常建议的时间, 而不是拒绝它们直到servlet容器重启。

Version:
$Version$
Author:
Various
See Also:
Serialized Form

 

Constructor Summary
UnavailableException(int seconds, Servlet servlet, String msg)
          Deprecated. As of Java Servlet API 2.2, use UnavailableException(String, int) instead. 从Java Servlet API 2.2以来,不再推荐使用。用UnavailableException(String, int)替代。
UnavailableException(Servlet servlet, String msg)
          Deprecated. As of Java Servlet API 2.2, use UnavailableException(String) instead. 从Java Servlet API 2.2以来,不再推荐使用。用UnavailableException(String)替代。
UnavailableException(String msg)
          Constructs a new exception with a descriptive message indicating that the servlet is permanently unavailable. 使用描述信息构建一个新异常,表明servlet永久不可用。
UnavailableException(String msg, int seconds)
          Constructs a new exception with a descriptive message indicating that the servlet is temporarily unavailable and giving an estimate of how long it will be unavailable. 使用描述信息构建一个新异常,表明servlet暂时不可用,并给出不可用时间的估计。

 

Method Summary
 Servlet getServlet()
          Deprecated. As of Java Servlet API 2.2, with no replacement. Returns the servlet that is reporting its unavailability. 从Java Servlet API 2.2以来,不再推荐使用。没有替代方法。
 int getUnavailableSeconds()
          Returns the number of seconds the servlet expects to be temporarily unavailable. 返回servlet预期不可用的秒数。
 boolean isPermanent()
          Returns a boolean indicating whether the servlet is permanently unavailable. 返回布尔值,表明servlet是否永久不可用。

抱歉!评论已关闭.