javax.servlet.UnavailableException翻译

来源:互联网 发布:sar算法 编辑:程序博客网 时间:2024/04/30 03:27
 Overview Package  Class Tree Deprecated Index Help JavaTM 2 Platform
Ent. Ed. v1.4
 PREV CLASS   NEXT CLASSFRAMES    NO FRAMES     All Classes SUMMARY: NESTED | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD

javax.servlet
Class UnavailableException

java.lang.Object  extended byjava.lang.Throwable      extended byjava.lang.Exception          extended byjavax.servlet.ServletException              extended byjavax.servlet.UnavailableException
All Implemented Interfaces:
Serializable

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 SummaryUnavailableException(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 ServletgetServlet()
          Deprecated. As of Java Servlet API 2.2, with no replacement. Returns the servlet that is reporting its unavailability. 从Java Servlet API 2.2以来,不再推荐使用。没有替代方法。
 intgetUnavailableSeconds()
          Returns the number of seconds the servlet expects to be temporarily unavailable. 返回servlet预期不可用的秒数。
 booleanisPermanent()
          Returns a boolean indicating whether the servlet is permanently unavailable. 返回布尔值,表明servlet是否永久不可用。
  Methods inherited from class javax.servlet.ServletExceptiongetRootCause  Methods inherited from class java.lang.ThrowablefillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString  Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 

Constructor Detail

UnavailableException

public UnavailableException(Servlet servlet,                            String msg)
Deprecated. As of Java Servlet API 2.2, use UnavailableException(String) instead. 从Java Servlet API 2.2以来,不再推荐使用。用UnavailableException(String)替代。

Parameters:
servlet - the Servlet instance that is unavailable 不可用的servlet实例
msg - a String specifying the descriptive message 一个String,表示描述信息

UnavailableException

public 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)替代。

Parameters:
seconds - an integer specifying the number of seconds the servlet expects to be unavailable; if zero or negative, indicates that the servlet can't make an estimate 一个整数,表明servlet预计不可用的秒数,如果为0或负数, 表明servlet不能做出估计
servlet - the Servlet that is unavailable 不可用的servlet
msg - a String specifying the descriptive message, which can be written to a log file or displayed for the user. 一个String,表示描述信息,它会被写入日志文件或显示给用户。

UnavailableException

public UnavailableException(String msg)
Constructs a new exception with a descriptive message indicating that the servlet is permanently unavailable. 使用描述信息构建一个新异常,表明servlet永久不可用。

Parameters:
msg - a String specifying the descriptive message 一个String,表示描述信息

UnavailableException

public 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暂时不可用,并给出不可用时间的估计。

In some cases, the servlet cannot make an estimate. For example, the servlet might know that a server it needs is not running, but not be able to report how long it will take to be restored to functionality. This can be indicated with a negative or zero value for the seconds argument. 在某些情况下,servlet不可能给出估计值。比如,servlet可能知道它所需要的 服务器不在运行,但是并不能报告要花多久才能恢复功能。如果这样,它将以负数或0表示seconds参数。

Parameters:
msg - a String specifying the descriptive message, which can be written to a log file or displayed for the user. 一个String,表示描述信息,它会被写入日志文件或显示给用户。
seconds - an integer specifying the number of seconds the servlet expects to be unavailable; if zero or negative, indicates that the servlet can't make an estimate 一个整数,表明servlet预计不可用的秒数,如果为0或负数, 表明servlet不能做出估计
Method Detail

isPermanent

public boolean isPermanent()
Returns a boolean indicating whether the servlet is permanently unavailable. If so, something is wrong with the servlet, and the system administrator must take some corrective action. 返回布尔值,表明servlet是否永久不可用。 如果是,表示servlet出错, 系统管理员应该采取纠正措施。

Returns:
true if the servlet is permanently unavailable; false if the servlet is available or temporarily unavailable 如果servlet永久不可用,返回true,如果servlet可用或暂时不可用,返回false

getServlet

public 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以来,不再推荐使用。没有替代方法。 返回报告不可用的servlet。

Returns:
the Servlet object that is throwing the UnavailableException 抛出UnavailableException的Servlet对象

getUnavailableSeconds

public int getUnavailableSeconds()
Returns the number of seconds the servlet expects to be temporarily unavailable. 返回servlet预期不可用的秒数。

If this method returns a negative number, the servlet is permanently unavailable or cannot provide an estimate of how long it will be unavailable. No effort is made to correct for the time elapsed since the exception was first reported. 如果方法返回负值,表示servlet永久不可用,不能给出不可用时间的估计值。 从第一次报告异常以来不会采取措施来修正过去的时间。

Returns:
an integer specifying the number of seconds the servlet will be temporarily unavailable, or a negative number if the servlet is permanently unavailable or cannot make an estimate 一个整数,表示servlet将暂时不可用的秒数,如果servlet永久不可用,不能给出估计值,返回负数

Overview Package  Class Tree Deprecated Index Help JavaTM 2 Platform
Ent. Ed. v1.4
 PREV CLASS   NEXT CLASSFRAMES    NO FRAMES     All Classes SUMMARY: NESTED | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.

原创粉丝点击