|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--org.eclipse.hyades.logging.events.cbe.EventException
Base for all exceptions in CBE package.
The EventException class is a subclass
of java.lang.Exception that provides support for
exception chaining semantics for pre-JDK v1.4 run-times.
It should be noted that this class provides only the exception chaining semantics available in JDK v1.4 which is a subset of new exception functionality introduced in JDK v1.4. Most of the new functionality requires support from the JVM that is not available on earlier run-times.
Exceptions that subclass this exception only need to add the various constructors and inherit everything else from this class.
See the API documentation for java.lang.Throwable in
JDK v1.4 for a full description of the exception chaining functionality.
EventException also provides support for localized
(language-specific) messages.
A EventException contains the following
components:
Objects which can be inserted into the
message text. These parameters are required only if the message
expects them. These objects are processed according to the rules
of the java.text.MessageFormat class.
java.lang.Throwable whose message text will be
displayed along with that of this EventException.
Exception,
Serialized Form| Field Summary | |
|---|---|
protected java.lang.String |
key
The key of the message associated with this text. |
protected java.lang.Object[] |
parameters
Parameters to be included in the message. |
protected java.lang.String |
resourceBundleName
Base name of the ResourceBundle in which the text is found. |
| Constructor Summary | |
|---|---|
EventException()
Construct a new EventException with
a null detail message and an uninitialized cause field. |
|
EventException(java.lang.String message)
Construct a new EventException with
the specified detail message and an uninitialized cause
field. |
|
EventException(java.lang.String key,
java.lang.String resourceBundleName)
Creates a EventException with a detail message, message
translation information (resource bundle, message key and message
substitutions). |
|
EventException(java.lang.String key,
java.lang.String resourceBundleName,
java.lang.Object[] parameters)
Creates a EventException with a
detail message, message translation information (resource
bundle, message key and message substitutions). |
|
EventException(java.lang.String key,
java.lang.String resourceBundleName,
java.lang.Object[] parameters,
java.lang.Throwable cause)
Creates a EventException with a
detail message, message translation information (resource
bundle, message key and message substitutions) and a nested
exception. |
|
EventException(java.lang.String message,
java.lang.Throwable cause)
Construct a new EventException with
a null detail message and a cause field set to the specified
Throwable. |
|
EventException(java.lang.Throwable cause)
Construct a new EventException with
a null detail message and a cause field set to the specified
Throwable. |
|
| Method Summary | |
|---|---|
java.lang.Throwable |
getCause()
Return the Throwable that is considered the root cause of this EventException. |
java.lang.String |
getKey()
Gets the message key. |
java.lang.String |
getLocalizedMessage()
Gets the text of the exception message, translated into the current locale. |
java.lang.String |
getLocalizedMessage(java.util.Locale locale)
Gets the text of the exception message, translated into the specified locale. |
java.lang.String |
getMessage()
Gets the text of the exception message. |
java.lang.Throwable |
initCause(java.lang.Throwable cause)
Initialize the cause field for this EventException to the specified
value. |
void |
printStackTrace()
Print this EventException and its
backtrace to System.err. |
void |
printStackTrace(java.io.PrintStream stream)
Print this EventException and its
backtrace to the specified print stream. |
void |
printStackTrace(java.io.PrintWriter writer)
Print this EventException and its
backtrace to the specified print writer. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String resourceBundleName
protected java.lang.String key
protected java.lang.Object[] parameters
| Constructor Detail |
public EventException()
EventException with
a null detail message and an uninitialized cause field. The
cause may subsequently be initialized via calling the initCause(java.lang.Throwable) method.
public EventException(java.lang.String message)
EventException with
the specified detail message and an uninitialized cause
field. The cause may subsequently be initialized via calling
the initCause(java.lang.Throwable) method.
message - a detail message. Null is tolerated.
public EventException(java.lang.String key,
java.lang.String resourceBundleName)
EventException with a detail message, message
translation information (resource bundle, message key and message
substitutions).
key - The message key.resourceBundleName - The name of the message ResourceBundle to use.public EventException(java.lang.Throwable cause)
EventException with
a null detail message and a cause field set to the specified
Throwable. Subsequent calls to the initCause(java.lang.Throwable) method
on this instance will result in an exception. The value of
the cause field may be retrieved at any time via the getCause() method.
cause - the Throwable that was caught and is considered
the root cause of this exception. Null is tolerated.
public EventException(java.lang.String message,
java.lang.Throwable cause)
EventException with
a null detail message and a cause field set to the specified
Throwable. Subsequent calls to the initCause(java.lang.Throwable) method
on this instance will result in an exception. The value of
the cause field may be retrieved at any time via the getCause() method.
message - the detail message. Null is tolerated.cause - the Throwable that was caught and is considered
the root cause of this exception. Null is tolerated.
public EventException(java.lang.String key,
java.lang.String resourceBundleName,
java.lang.Object[] parameters)
EventException with a
detail message, message translation information (resource
bundle, message key and message substitutions).
key - The message key.resourceBundleName - The name of the message ResourceBundle to use.parameters - An array of elements to be inserted into the
message.
public EventException(java.lang.String key,
java.lang.String resourceBundleName,
java.lang.Object[] parameters,
java.lang.Throwable cause)
EventException with a
detail message, message translation information (resource
bundle, message key and message substitutions) and a nested
exception.
key - The message key.resourceBundleName - The name of the message ResourceBundle to use.parameters - An array of elements to be inserted into the
message.cause - The nested exception, or null, if a
nested exception is not appropriate.| Method Detail |
public java.lang.Throwable getCause()
EventException. Null is returned
if the root cause is nonexistent or unknown. The root cause
is the throwable that caused this
EventException to get thrown.
The Throwable that is returned is either the Throwable
supplied via one of the appropriate constructors, or that set
via the initCause(Throwable) method. While it is
typically unnecessary to override this method, a subclass can
override it to return a cause set by some other means, such
as a legacy exception chaining infrastructure.
getCause in class java.lang.ThrowableEventException, or null if
the cause is nonexistent or unknown.public java.lang.String getKey()
public java.lang.String getLocalizedMessage()
getLocalizedMessage in class java.lang.Throwablepublic java.lang.String getLocalizedMessage(java.util.Locale locale)
locale - The locale to use for translation of the
exception message, or null to use the
default locale.
public java.lang.String getMessage()
getLocalizedMessage(Locale.ENGLISH).
getMessage in class java.lang.Throwable
public java.lang.Throwable initCause(java.lang.Throwable cause)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
EventException to the specified
value. The cause is the Throwable that caused this
EventException to get thrown.
This method can be called at most once. It is generally called from within a constructor that takes a Throwable, or immediately after constructing this object with a constructor that does not accept a Throwable. Thus, if a constructor that takes Throwable as a parameter is used to construct this object, it cannot be called at all.
initCause in class java.lang.Throwablecause - the Throwable which caused this
EventException to be
thrown. Null is tolerated.
Throwable instance.
java.lang.IllegalStateException - if this
EventException was
created with a constructor that specified a cause,
or this method has already been called on this
object.
java.lang.IllegalArgumentException - if the specified cause is
this EventException. An
exception cannot be its own cause.public void printStackTrace()
EventException and its
backtrace to System.err.
printStackTrace in class java.lang.Throwablepublic void printStackTrace(java.io.PrintStream stream)
EventException and its
backtrace to the specified print stream.
printStackTrace in class java.lang.Throwablestream - the PrintStream to use for outputpublic void printStackTrace(java.io.PrintWriter writer)
EventException and its
backtrace to the specified print writer.
printStackTrace in class java.lang.Throwablewriter - the PrintWriter to use for output
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||