|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable com.levigo.util.base.MimicryThrowable
public class MimicryThrowable
A Throwable
used to mimic arbitrary Throwables for serialization
purposes. An RMI client may not have all Throwable implementations used by
the server on its class path. In order to allow a rich communication of, for
instance, an exception cause chain, the MimicryThrowable
assumes the
role of the mimic'ed Throwable.
Mimic'ed Throwables exhibit the mimic'ed Throwable's behavior in all behavior
of a generic Throwable. Examples are toString()
, Throwable.getCause()
,
Throwable.getStackTrace()
Throwable.printStackTrace()
etc. Behavior specific
to a particular subclass of Throwable, however, is not mimic'ed. Also, please
be aware that all operations involving instanceof
expressions or
Object.getClass()
will let the real nature of the MimicryThrowable
show through.
Field Summary | |
---|---|
static String[] |
UNMIMICED_PACKAGE_PREFIXES
A list of package prefixes for which no mimicry is performed through mimic(Throwable) (all from java.* ). |
Constructor Summary | |
---|---|
MimicryThrowable(String className,
String message,
String localizedMessage,
StackTraceElement[] stacktrace,
Throwable cause)
Creates a new MimicryThrowable from scratch |
|
MimicryThrowable(Throwable t)
Mimics the given Throwable . |
Method Summary | |
---|---|
Throwable |
fillInStackTrace()
|
String |
getClassName()
|
String |
getLocalizedMessage()
|
static Throwable |
mimic(Throwable t)
Return the mimic'ed Throwable unless mimicry isn't required for it. |
String |
toString()
|
Methods inherited from class java.lang.Throwable |
---|
getCause, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String[] UNMIMICED_PACKAGE_PREFIXES
mimic(Throwable)
(all from java.*
).
Constructor Detail |
---|
public MimicryThrowable(Throwable t)
Throwable
.
t
- The Throwable
to mimic.public MimicryThrowable(String className, String message, String localizedMessage, StackTraceElement[] stacktrace, Throwable cause)
MimicryThrowable
from scratch
className
- The class name to mimicmessage
- The detail message to mimiclocalizedMessage
- The localized description to mimic or null
stacktrace
- the stack trace elements to mimiccause
- The cause or null
. This element will be mimiced, too.Method Detail |
---|
public static Throwable mimic(Throwable t)
Throwable
unless mimicry isn't required for it.
t
- The Throwable to mimicry
public Throwable fillInStackTrace()
fillInStackTrace
in class Throwable
public String getLocalizedMessage()
getLocalizedMessage
in class Throwable
public String toString()
toString
in class Throwable
public String getClassName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |