Class MimicryThrowable

  • All Implemented Interfaces:
    Serializable

    public class MimicryThrowable
    extends Throwable
    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.

    See Also:
    Serialized Form
    • Field Detail

      • UNMIMICED_PACKAGE_PREFIXES

        public static final String[] UNMIMICED_PACKAGE_PREFIXES
        A list of package prefixes for which no mimicry is performed through mimic(Throwable) (all from java.*).
    • Constructor Detail

      • MimicryThrowable

        public MimicryThrowable​(Throwable t)