org.identityconnectors.contract.exceptions
Class ContractException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.identityconnectors.contract.exceptions.ContractException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ObjectNotFoundException

public class ContractException
extends RuntimeException

Generic Contract Tests exception. Base class for all contract tests exceptions.

See Also:
Serialized Form

Constructor Summary
ContractException()
           
ContractException(String message)
          Sets a message for the Exception.
ContractException(String message, Throwable originalException)
          Sets the stack trace to the original exception, so this exception can masquerade as the original only be a RuntimeException.
ContractException(Throwable originalException)
          Sets the stack trace to the original exception, so this exception can masquerade as the original only be a RuntimeException.
 
Method Summary
 void rethrow()
          Re-throw the original exception.
static RuntimeException wrap(Throwable ex)
          If Exception parameter passed in is a RuntimeException it is simply returned.
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContractException

public ContractException()

ContractException

public ContractException(String message)
Sets a message for the Exception.

Parameters:
message - passed to the RuntimeException message.

ContractException

public ContractException(Throwable originalException)
Sets the stack trace to the original exception, so this exception can masquerade as the original only be a RuntimeException.

Parameters:
originalException - the original exception adapted to RuntimeException.

ContractException

public ContractException(String message,
                         Throwable originalException)
Sets the stack trace to the original exception, so this exception can masquerade as the original only be a RuntimeException.

Parameters:
message -
originalException - the original exception adapted to RuntimeException.
Method Detail

rethrow

public void rethrow()
             throws Throwable
Re-throw the original exception.

Throws:
Exception - throws the original passed in the constructor.
Throwable

wrap

public static RuntimeException wrap(Throwable ex)
If Exception parameter passed in is a RuntimeException it is simply returned. Otherwise the Exception is wrapped in a ContractException and returned.

Parameters:
ex - Exception to wrap or cast and return.
Returns:
a RuntimeException that either is the specified exception or contains the specified exception.


Copyright © 2012. All Rights Reserved.