org.marketcetera.util.ws.wrappers
Class RemoteException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.marketcetera.util.ws.wrappers.RemoteException
All Implemented Interfaces:
Externalizable, Serializable

public class RemoteException
extends Exception
implements Externalizable

A remote exception. It wraps any Throwable in a manner that enables its marshalling using JAXB in the context of web service faults, or for use by Java serialization in other contexts; this is done by serializing the throwable and marshalling it using a SerWrapper. On the server side, this class sets the wrapped throwable as its cause. This also happens on the client side, provided the client runs in a JVM which is able to deserialize the throwable (because it has the right resources and classes available in its classpath). Otherwise, the cause is an instance of RemoteProxyException, which encapsulates the throwable's most important information, as conveyed via a RemoteProperties instance.

Equality and hash code generation rely only on a temporary RemoteProperties instance created for comparison purposes from the receiver's cause; notably, the class of the cause is ignored.

Since:
1.0.0
Version:
$Id: RemoteException.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com
See Also:
Serialized Form

Constructor Summary
RemoteException()
          Creates a new exception.
RemoteException(Throwable t)
          Creates a new exception that wraps the given throwable.
 
Method Summary
 boolean equals(Object other)
           
 RemoteProperties getProperties()
          Returns the receiver's properties.
 int hashCode()
           
 void readExternal(ObjectInput in)
           
 void setProperties(RemoteProperties properties)
          Set the receiver's properties to the given ones.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteException

public RemoteException(Throwable t)
Creates a new exception that wraps the given throwable.

Parameters:
t - The throwable, which may be null.

RemoteException

public RemoteException()
Creates a new exception. This empty constructor is intended for use by JAXB and Java serialization.

Method Detail

setProperties

public void setProperties(RemoteProperties properties)
Set the receiver's properties to the given ones. This method can only be called once with a non-null argument because a side effect is that it sets the receiver's cause based on its non-null argument.

Parameters:
properties - The properties, which may be null.

getProperties

public RemoteProperties getProperties()
Returns the receiver's properties.

Returns:
The properties, which may be null.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object


Copyright © 2012. All Rights Reserved.