Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

org.apache.jetspeed.portlet
Class UnavailableException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjavax.servlet.ServletException
              extended byorg.apache.jetspeed.portlet.PortletException
                  extended byorg.apache.jetspeed.portlet.UnavailableException
All Implemented Interfaces:
java.io.Serializable

public class UnavailableException
extends org.apache.jetspeed.portlet.PortletException

Use the UnavailableException when the instantiation of a portlet fails.

Since:
4.1
See Also:
Portlet.init(PortletConfig), Serialized Form

Constructor Summary
UnavailableException(int seconds, Portlet portlet, java.lang.String msg)
          Deprecated. use UnavailableException(String, int) instead.
UnavailableException(Portlet portlet, java.lang.String msg)
          Deprecated. use UnavailableException(String) instead.
UnavailableException(java.lang.String msg)
          Constructs a new exception with a descriptive message indicating that the portlet is permanently unavailable.
UnavailableException(java.lang.String msg, int seconds)
          Constructs a new exception with a descriptive message indicating that the portlet is temporarily unavailable and giving an estimate of how long it will be unavailable.
 

Method Summary
 Portlet getPortlet()
          Deprecated. no replacement. Returns the portlet that is reporting its unavailability.
 int getUnavailableSeconds()
          Returns the number of seconds the portlet expects to be temporarily unavailable.
 boolean isPermanent()
          Returns a boolean indicating whether the portlet is permanently unavailable.
 void printStackTrace()
          Prints the stack trace of this exception to the standard error stream.
 void printStackTrace(java.io.PrintStream out)
          Prints the stack trace of this exception to the specified print stream.
 void printStackTrace(java.io.PrintWriter out)
          Prints the stack trace of this exception to the specified print writer.
 

Methods inherited from class javax.servlet.ServletException
getRootCause
 

Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnavailableException

public UnavailableException(Portlet portlet,
                            java.lang.String msg)
Deprecated. use UnavailableException(String) instead.

Parameters:
portlet - the Portlet instance that is unavailable
msg - a String specifying the descriptive message

UnavailableException

public UnavailableException(int seconds,
                            Portlet portlet,
                            java.lang.String msg)
Deprecated. use UnavailableException(String, int) instead.

Parameters:
seconds - an integer specifying the number of seconds the portlet expects to be unavailable; if zero or negative, indicates that the portlet can't make an estimate
portlet - the Portlet that is unavailable
msg - a String specifying the descriptive message, which can be written to a log file or displayed for the user.

UnavailableException

public UnavailableException(java.lang.String msg)
Constructs a new exception with a descriptive message indicating that the portlet is permanently unavailable.

Parameters:
msg - a String specifying the descriptive message

UnavailableException

public UnavailableException(java.lang.String msg,
                            int seconds)
Constructs a new exception with a descriptive message indicating that the portlet is temporarily unavailable and giving an estimate of how long it will be unavailable.

In some cases, the portlet cannot make an estimate. For example, the portlet 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.

Parameters:
msg - a String specifying the descriptive message, which can be written to a log file or displayed for the user.
seconds - an integer specifying the number of seconds the portlet expects to be unavailable; if zero or negative, indicates that the portlet can't make an estimate

Method Detail

isPermanent

public boolean isPermanent()
Returns a boolean indicating whether the portlet is permanently unavailable. If so, something is wrong with the portlet, and the system administrator must take some corrective action.

Returns:
true if the portlet is permanently unavailable; false if the portlet is available or temporarily unavailable

getPortlet

public Portlet getPortlet()
Deprecated. no replacement. Returns the portlet that is reporting its unavailability.

Returns:
the Portlet object that is throwing the UnavailableException

getUnavailableSeconds

public int getUnavailableSeconds()
Returns the number of seconds the portlet expects to be temporarily unavailable.

If this method returns a negative number, the portlet 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.

Returns:
an integer specifying the number of seconds the portlet will be temporarily unavailable, or a negative number if the portlet is permanently unavailable or cannot make an estimate

printStackTrace

public void printStackTrace()
Prints the stack trace of this exception to the standard error stream.


printStackTrace

public void printStackTrace(java.io.PrintStream out)
Prints the stack trace of this exception to the specified print stream.

Parameters:
out - the PrintStream to use for output

printStackTrace

public void printStackTrace(java.io.PrintWriter out)
Prints the stack trace of this exception to the specified print writer.

Parameters:
out - the PrintWriter to use for output.

Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.