com.sun.sgs.impl.sharedutil
Class Exceptions

java.lang.Object
  extended by com.sun.sgs.impl.sharedutil.Exceptions

public final class Exceptions
extends Object

Utility methods for working with Exceptions.


Method Summary
static
<T extends Throwable>
T
initCause(T exception, Throwable cause)
          Returns the given exception with its cause initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initCause

public static <T extends Throwable> T initCause(T exception,
                                                Throwable cause)
Returns the given exception with its cause initialized. The original exception is returned in a typesafe way so that it can be thrown easily.

Type Parameters:
T - the type of the parent exception
Parameters:
exception - the exception to initialize
cause - the cause
Returns:
the exception with its cause initialized
Throws:
IllegalArgumentException - if an attempt is made to set an exception as its own cause
IllegalStateException - if the exception has already had its cause initialized
See Also:
Throwable.initCause(Throwable)

Project Darkstar, Version 0.9.10.7
2013-07-29 21:20:19

Copyright © 2007-2013 Sun Microsystems, Inc. All rights reserved