Overview | Package | Class | Tree | Deprecated | Index | Help
| The PDK Java API is part of the Portal Developer Kit on Portal Studio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.portal
Class PortalException

    java.lang.Object
      |
      +--java.lang.Throwable
            |
            +--java.lang.Exception
                  |
                  +--oracle.portal.PortalException

All Implemented Interfaces:
  oracle.webdb.utils.PortalExceptionIF, java.io.Serializable

Direct Known Subclasses:
  PreferenceStoreException

public class PortalException
extends java.lang.Exception
implements oracle.webdb.utils.PortalExceptionIF

The PortalException class represents the Base exception that the Portal Java service library will throw. It encapsulates the NLS needs of the service library by taking the name of a resource bundle, and the name of the associate resource, instead of a literal text string for any error message to be produced. Callers wanting to display the error contained in the Exception can call getMessage() or a new method getMessage(Locale) in order to extract the error message string contained within the exception. Instances of this class can be "chained" together. Whenever one exception is caught and a second one is raised, the second one should be created by specifying the first one as the cause. This avoids the loss of information that is typical in these situations. Hypothetical code snippet: catch (ClassCastException e) { throw new PortalClassCastException(resource, name, e); } The printStackTrace methods in this class override those in the Exception class so that the entire exception chain is displayed. NOTE : If your application lies under different classloader you would have to extend from oracle.portal.PortalException

See Also:
  Serialized Form

Constructor Summary
`PortalException(java.lang.String msg)` Constructor.
`PortalException(java.lang.String resource, java.lang.String name)` Constructor.
`PortalException(java.lang.String resource, java.lang.String name, java.lang.Object[] args)` Constructor.
`PortalException(java.lang.String resource, java.lang.String name, java.lang.Object[] args, java.lang.Throwable cause)` Construct a Portal exception with a complete set of parameters.

Method Summary
`java.lang.Throwable` | `getCause()` Get the cause of this exception.
`java.lang.String` | `getMessage()` Get the message from the Exception.
`java.lang.String` | `getMessage(java.util.Locale locale)` Get the message from the Exception in the requested Locale.
`void` | `printStackTrace()` Print this exception and its backtrace to the standard error stream.
`void` | `printStackTrace(java.io.PrintStream stream)` Print this exception and its backtrace to the given stream.
`void` | `printStackTrace(java.io.PrintWriter writer)` Print this exception and its backtrace to the given print writer.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getLocalizedMessage, toString`

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

Constructor Detail

### PortalException

    public PortalException(java.lang.String resource,
                           java.lang.String name,
                           java.lang.Object[] args,
                           java.lang.Throwable cause)

  Construct a Portal exception with a complete set of parameters.
  Parameters:
    `resource` - the name of the resource bundle with the error string.
    `name` - the name of the resource within the resource bundle.
    `args` - optional arguments formatted into the msg via MessageFormat.
    `cause` - optional cause of this exception.

### PortalException

    public PortalException(java.lang.String resource,
                           java.lang.String name,
                           java.lang.Object[] args)

  Constructor.
  Parameters:
    `resource` - the name of the resource bundle with the error string.
    `name` - the name of the resource within the resource bundle.
    `args` - optional arguments formatted into the msg via MessageFormat.

### PortalException

    public PortalException(java.lang.String resource,
                           java.lang.String name)

  Constructor. This is a convenience for calling the full constructor and providing no parameter arguments.
  Parameters:
    `resource` - the name of the resource bundle with the error string.
    `name` - the name of the resource within the resource bundle.

### PortalException

    public PortalException(java.lang.String msg)

  Constructor. This constructor is deprecated and only here as a placeholder.

Method Detail

### getMessage

    public java.lang.String getMessage()

  Get the message from the Exception.
  Overrides:
    `getMessage` in class `java.lang.Throwable`
  Returns:
    the string error message, formatted and translated using the default Locale.

### getMessage

    public java.lang.String getMessage(java.util.Locale locale)

  Get the message from the Exception in the requested Locale.
  Specified by:
    `getMessage` in interface `oracle.webdb.utils.PortalExceptionIF`
  Parameters:
    `locale` - the locale to use to extract the error message.
  Returns:
    the string error message, formatted and translated using the requested Locale.

### getCause

    public java.lang.Throwable getCause()

  Get the cause of this exception.
  Returns:
    the possibly null cause

### printStackTrace

    public void printStackTrace()

  Print this exception and its backtrace to the standard error stream. Note: it is necessary to override this method (and not just the two that follow) because the JDK implementation of Throwable.printStackTrace() calls one of its own private methods instead of printStackTrace(PrintStream stream)!
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`

### printStackTrace

    public void printStackTrace(java.io.PrintStream stream)

  Print this exception and its backtrace to the given stream.
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`
  Parameters:
    `stream` - the print stream to use for output.

### printStackTrace

    public void printStackTrace(java.io.PrintWriter writer)

  Print this exception and its backtrace to the given print writer.
  Overrides:
    `printStackTrace` in class `java.lang.Throwable`
  Parameters:
    `stream` - the print writer to use for output.

Overview | Package | Class | Tree | Deprecated | Index | Help
| The PDK Java API is part of the Portal Developer Kit on Portal Studio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2002, Oracle Corporation. All Rights Reserved.