CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.io.pof
Class PortableException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.tangosol.io.pof.PortableException
All Implemented Interfaces:
PortableObject, Externalizable, Serializable

public class PortableException
extends RuntimeException
implements PortableObject, Externalizable

A PortableException is an exception that allows information about a remote exception or error to be serialized and deserialized to/from a POF stream.

Author:
jh 2006.08.04

Constructor Summary
PortableException()
          Default constructor (for PortableObject).
PortableException(String s)
          Construct a PortableException with a specified detail message.
PortableException(String s, Throwable e)
          Construct a PortableException with a specified detail message and cause.
PortableException(Throwable e)
          Construct a PortableException with a specified cause.
 
Method Summary
 String getLocalizedMessage()
          Return a localized description of this PortableException
 String getMessage()
          Return the detail message of this PortableException
protected  String getRemoteMessage()
          Return a wrapped detail message indicating that this PortableException was deserialized from a POF stream
protected  String getStackTrace(Throwable e)
          Return a string that contains the stack trace information of the given Throwable.
 void printStackTrace()
          Print this PortableException and its stack trace to the standard error stream.
 void printStackTrace(PrintStream stream)
          Print this PortableException and its stack trace to the specified PrintStream.
 void printStackTrace(PrintWriter writer)
          Print this PortableException and its stack trace to the specified PrintWriter.
 void readExternal(ObjectInput in)
          The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
 void readExternal(PofReader in)
          Restore the contents of a user type instance by reading its state using the specified PofReader object.
 String toString()
          Return a short description of this PortableException
 void writeExternal(ObjectOutput out)
          The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
 void writeExternal(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
fillInStackTrace, getCause, getStackTrace, initCause, setStackTrace
 

Constructor Detail

PortableException

public PortableException()
Default constructor (for PortableObject).


PortableException

public PortableException(String s)
Construct a PortableException with a specified detail message.

Parameters:
s - the String that contains the detail message; this message may be retrieved via the getMessage() method

PortableException

public PortableException(String s,
                         Throwable e)
Construct a PortableException with a specified detail message and cause.

Parameters:
s - the String that contains the detail message; this message may be retrieved via the getMessage() method
e - the Throwable object that is the cause of the exception; this Throwable may be retrieved via the Throwable.getCause() method

PortableException

public PortableException(Throwable e)
Construct a PortableException with a specified cause.

Parameters:
e - the Throwable object that is the cause of the exception; this Throwable may be retrieved via the Throwable.getCause() method
Method Detail

getMessage

public String getMessage()
Return the detail message of this PortableException

Overrides:
getMessage in class Throwable
Returns:
the detail message

getLocalizedMessage

public String getLocalizedMessage()
Return a localized description of this PortableException

Overrides:
getLocalizedMessage in class Throwable
Returns:
The localized description

toString

public String toString()
Return a short description of this PortableException

Overrides:
toString in class Throwable
Returns:
a string representation of this PortableException

printStackTrace

public void printStackTrace()
Print this PortableException and its stack trace to the standard error stream.

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream stream)
Print this PortableException and its stack trace to the specified PrintStream.

Overrides:
printStackTrace in class Throwable
Parameters:
stream - PrintStream to use for output

printStackTrace

public void printStackTrace(PrintWriter writer)
Print this PortableException and its stack trace to the specified PrintWriter.

Overrides:
printStackTrace in class Throwable
Parameters:
writer - PrintWriter to use for output

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Specified by:
readExternal in interface Externalizable
Parameters:
in - the stream to read data from in order to restore the object
Throws:
IOException - if I/O errors occur
ClassNotFoundException - if the class for an object being restored cannot be found.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Specified by:
writeExternal in interface Externalizable
Parameters:
out - the stream to write the object to
Throws:
IOException - includes any I/O exceptions that may occur

readExternal

public void readExternal(PofReader in)
                  throws IOException
Restore the contents of a user type instance by reading its state using the specified PofReader object.

Specified by:
readExternal in interface PortableObject
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
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.

Specified by:
writeExternal in interface PortableObject
Parameters:
out - the PofWriter to which to write the object's state
Throws:
IOException - if an I/O error occurs

getRemoteMessage

protected String getRemoteMessage()
Return a wrapped detail message indicating that this PortableException was deserialized from a POF stream

Returns:
a wrapped detail message; never null

getStackTrace

protected String getStackTrace(Throwable e)
Return a string that contains the stack trace information of the given Throwable.

Parameters:
e - the Throwable
Returns:
the stack trace information of the given Throwable as a string

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation