public class MimicryThrowable extends Throwable
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.
Modifier and Type | Field and Description |
---|---|
static String[] |
UNMIMICED_PACKAGE_PREFIXES
A list of package prefixes for which no mimicry is performed through
mimic(Throwable) (all from java.* ). |
Constructor and Description |
---|
MimicryThrowable(Throwable t) |
Modifier and Type | Method and Description |
---|---|
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() |
addSuppressed, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public static final String[] UNMIMICED_PACKAGE_PREFIXES
mimic(Throwable)
(all from java.*
).public MimicryThrowable(Throwable t)
public static Throwable mimic(Throwable t)
Throwable
unless mimicry isn't required for it.t
- The Throwable to mimicrypublic Throwable fillInStackTrace()
fillInStackTrace
in class Throwable
public String getLocalizedMessage()
getLocalizedMessage
in class Throwable
public String getClassName()
Copyright © 2017 levigo holding gmbh. All rights reserved.