Package com.tangosol.io.pof
Class PortableException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.tangosol.io.pof.PortableException
-
- All Implemented Interfaces:
PortableObject,SerializationSupport,Serializable
- Direct Known Subclasses:
RequestIncompleteException,RequestPolicyException
public class PortableException extends RuntimeException implements PortableObject, SerializationSupport
APortableExceptionis an exception that allows information about a remote exception or error to be serialized and deserialized to/from aPOFstream.- Author:
- jh,mf 2006.08.04
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]m_asStackRemoteA raw representation of the remote stack trace for this exception.protected Stringm_sMessageThe exception's message.protected Stringm_sNameThe exception's name.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPortableException()Default constructor.protectedPortableException(String sMessage)Constructs aPortableExceptionwith the specified detail message.protectedPortableException(String sMessage, Throwable e)Construct aPortableExceptionfrom aThrowableobject and an additional description.protectedPortableException(Throwable e)Construct aPortableExceptionfrom aThrowableobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getFullStackTrace()Return an array of Strings containing the full representation of the stack trace.StringgetMessage()Return the detail message string of this PortableException.StringgetName()Return the name of the exception.voidprintStackTrace(PrintStream stream)Print thisPortableExceptionand its stack trace to the specified stream.voidprintStackTrace(PrintWriter writer)Print thisPortableExceptionand its stack trace to the specified writer.voidreadExternal(PofReader in)Restore the contents of a user type instance by reading its state using the specified PofReader object.ObjectreadResolve()Returns the original type, iff the type is a subclass ofPortableException, during deserialization opposed to a newPortableExceptionwith the metadata of the original exception.StringtoString()Return a human-readable description for this exception.voidwriteExternal(PofWriter out)Save the contents of a POF user type instance by writing its state using the specified PofWriter object.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tangosol.io.SerializationSupport
writeReplace
-
-
-
-
Constructor Detail
-
PortableException
protected PortableException()
Default constructor.
-
PortableException
protected PortableException(String sMessage)
Constructs aPortableExceptionwith the specified detail message.- Parameters:
sMessage- the String that contains a detailed message
-
PortableException
protected PortableException(Throwable e)
Construct aPortableExceptionfrom aThrowableobject.- Parameters:
e- theThrowableobject
-
-
Method Detail
-
readResolve
public Object readResolve() throws ObjectStreamException
Returns the original type, iff the type is a subclass ofPortableException, during deserialization opposed to a newPortableExceptionwith the metadata of the original exception.- Specified by:
readResolvein interfaceSerializationSupport- Returns:
- a reconstructed
PortableExceptionsubclass, if possible, otherwise returns the current instance - Throws:
ObjectStreamException- if an error occurs
-
getName
public String getName()
Return the name of the exception.- Returns:
- the name of the exception
-
getFullStackTrace
public String[] getFullStackTrace()
Return an array of Strings containing the full representation of the stack trace. The first element of the stack represents the exception's point of origin.- Returns:
- the full stack trace
-
readExternal
public void readExternal(PofReader in) throws IOException
Description copied from interface:PortableObjectRestore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternalin interfacePortableObject- Parameters:
in- the PofReader from which to read the object's state- Throws:
IOException- if an I/O error occurs
-
writeExternal
public void writeExternal(PofWriter out) throws IOException
Description copied from interface:PortableObjectSave the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternalin interfacePortableObject- Parameters:
out- the PofWriter to which to write the object's state- Throws:
IOException- if an I/O error occurs
-
getMessage
public String getMessage()
Return the detail message string of this PortableException.- Overrides:
getMessagein classThrowable- Returns:
- the detail message string (may be
null)
-
printStackTrace
public void printStackTrace(PrintStream stream)
Print thisPortableExceptionand its stack trace to the specified stream.- Overrides:
printStackTracein classThrowable- Parameters:
stream- thePrintStreamto use for the output
-
printStackTrace
public void printStackTrace(PrintWriter writer)
Print thisPortableExceptionand its stack trace to the specified writer.- Overrides:
printStackTracein classThrowable- Parameters:
writer- thePrintWriterto use for the output
-
-