|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.arquillian.test.spi.ExceptionProxy
public class ExceptionProxy
Takes an exception class and creates a proxy that can be used to rebuild the exception. The problem stems from problems serializing exceptions and deserializing them in another application where the exception classes might not exist, or they might exist in different version. This proxy also propagates the stacktrace and the cause exception to create totally portable exceptions.
This class creates a serializable proxy of the exception and when unserialized can be used to re-create the exception based on the following rules :
Constructor Summary | |
---|---|
ExceptionProxy()
|
|
ExceptionProxy(Throwable throwable)
|
Method Summary | |
---|---|
Throwable |
createException()
Constructs an instance of the proxied exception based on the class name, message, stack trace and if applicable, the cause. |
static ExceptionProxy |
createForException(Throwable throwable)
Static method to create an exception proxy for the passed in Throwable class. |
ArquillianProxyException |
createProxyException(String reason)
|
Throwable |
getCause()
Returns the cause of the exception represented by this proxy |
boolean |
hasException()
Indicates whether this proxy wraps an exception |
void |
readExternal(ObjectInput in)
Custom Serialization logic. |
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExceptionProxy()
public ExceptionProxy(Throwable throwable)
Method Detail |
---|
public boolean hasException()
public Throwable createException()
Throwable
instancepublic ArquillianProxyException createProxyException(String reason)
public static ExceptionProxy createForException(Throwable throwable)
Throwable
class. If null is passed in, null is returned as the
exception proxy
throwable
- Exception to proxy
public Throwable getCause()
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |