javax.servlet
Class UnavailableException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--javax.servlet.ServletException
                    |
                    +--javax.servlet.UnavailableException

public class UnavailableException
extends ServletException

This exception indicates that a servlet is unavailable. Servlets may report this exception at any time, and the network service running the servlet should behave appropriately. There are two types of unavailability, and sophisticated services will to deal with these differently:

Network services may safely treat both types of exceptions as "permanent", but good treatment of temporary unavailability leads to more robust network services. Specifically, requests to the servlet might be blocked (or otherwise deferred) for a servlet-suggested amount of time, rather than being rejected until the service itself restarts.

See Also:
Serialized Form

Constructor Summary
UnavailableException(int seconds, Servlet servlet, java.lang.String msg)
          Constructs a new exception with the specified descriptive message, indicating that the servlet is temporarily unavailable and giving an estimate of how long it will be unavailable.
UnavailableException(Servlet servlet, java.lang.String msg)
          Constructs a new exception with the specified descriptive message, indicating that the servlet is permanently unavailable.
 
Method Summary
 Servlet getServlet()
          Returns the servlet that is reporting its unavailability.
 int getUnavailableSeconds()
          Returns the amount of time the servlet expects to be temporarily unavailable.
 boolean isPermanent()
          Returns true if the servlet is "permanently" unavailable, indicating that the service administrator must take some corrective action to make the servlet be usable.
 
Methods inherited from class javax.servlet.ServletException
getRootCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnavailableException

public UnavailableException(Servlet servlet,
                            java.lang.String msg)
Constructs a new exception with the specified descriptive message, indicating that the servlet is permanently unavailable.
Parameters:
servlet - the servlet which is unavailable
msg - the descriptive message

UnavailableException

public UnavailableException(int seconds,
                            Servlet servlet,
                            java.lang.String msg)
Constructs a new exception with the specified descriptive message, indicating that the servlet is temporarily unavailable and giving an estimate of how long it will be unavailable. In some cases, no estimate can be made; this is indicated by a non-positive time. For example, the servlet might know a server it needs is "down", but not be able to report how long it will take to restore it to an adequate level of functionality.
Parameters:
seconds - number of seconds that the servlet is anticipated to be unavailable. If negative or zero, no estimate is available.
servlet - the servlet which is unavailable
msg - the descriptive message
Method Detail

isPermanent

public boolean isPermanent()
Returns true if the servlet is "permanently" unavailable, indicating that the service administrator must take some corrective action to make the servlet be usable.

getServlet

public Servlet getServlet()
Returns the servlet that is reporting its unavailability.

getUnavailableSeconds

public int getUnavailableSeconds()
Returns the amount of time the servlet expects to be temporarily unavailable. If the servlet is permanently unavailable, or no estimate was provided, returns a negative number. No effort is made to correct for the time elapsed since the exception was first reported.