Class MimicryThrowable
- java.lang.Object
-
- java.lang.Throwable
-
- com.levigo.jadice.server.jms.client.MimicryThrowable
-
- All Implemented Interfaces:
Serializable
public class MimicryThrowable extends Throwable
AThrowable
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, theMimicryThrowable
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 involvinginstanceof
expressions orObject.getClass()
will let the real nature of theMimicryThrowable
show through.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String[]
UNMIMICED_PACKAGE_PREFIXES
A list of package prefixes for which no mimicry is performed throughmimic(Throwable)
(all fromjava.*
).
-
Constructor Summary
Constructors Constructor Description MimicryThrowable(Throwable t)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Throwable
fillInStackTrace()
String
getClassName()
String
getLocalizedMessage()
static Throwable
mimic(Throwable t)
Return the mimic'edThrowable
unless mimicry isn't required for it.String
toString()
-
Methods inherited from class java.lang.Throwable
addSuppressed, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Field Detail
-
UNMIMICED_PACKAGE_PREFIXES
public static final String[] UNMIMICED_PACKAGE_PREFIXES
A list of package prefixes for which no mimicry is performed throughmimic(Throwable)
(all fromjava.*
).
-
-
Constructor Detail
-
MimicryThrowable
public MimicryThrowable(Throwable t)
-
-
Method Detail
-
mimic
public static Throwable mimic(Throwable t)
Return the mimic'edThrowable
unless mimicry isn't required for it.- Parameters:
t
- The Throwable to mimicry- Returns:
- A mimic'ed Throwable (if necessary)
-
fillInStackTrace
public Throwable fillInStackTrace()
- Overrides:
fillInStackTrace
in classThrowable
-
getLocalizedMessage
public String getLocalizedMessage()
- Overrides:
getLocalizedMessage
in classThrowable
-
getClassName
public String getClassName()
-
-