Package com.jogamp.common.util
Class SourcedInterruptedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.InterruptedException
com.jogamp.common.util.SourcedInterruptedException
- All Implemented Interfaces:
ExceptionUtils.CustomStackTrace,Serializable
public class SourcedInterruptedException
extends InterruptedException
implements ExceptionUtils.CustomStackTrace
InterruptedException, which may include the source, see getInterruptSource().
This exception may be created directly where getCause() returns null,
or by propagating an existing InterruptedException as returned by getCause().
- Since:
- 2.3.2
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSourcedInterruptedException(InterruptedException cause, Throwable interruptSource) SourcedInterruptedException(String message, InterruptedException cause, Throwable interruptSource) -
Method Summary
Modifier and TypeMethodDescriptiongetCause()Returns the propagatedInterruptedException, i.e.final ThrowableReturns the source of theThread.interrupt()call if known, otherwisenullis returned.final voidprintCauseStack(PrintStream s, String causeStr, int causeIdx, int stackDepth) final voidprintStackTrace(PrintStream s, int causeDepth, int stackDepth) CustomprintStackTracemethod, similar toThrowable#printStackTrace(PrintStream, int, int).toString()static InterruptedExceptionWraps the givenInterruptedExceptioninto aSourcedInterruptedExceptionif it is not yet of the desired type and if the current thread if aInterruptSource, i.e.static InterruptedExceptionwrap(InterruptedException ie, InterruptSource source) Wraps the givenInterruptedExceptioninto aSourcedInterruptedExceptionif it is not yet of the same type and ifsourceis notnull.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
SourcedInterruptedException
public SourcedInterruptedException(String message, InterruptedException cause, Throwable interruptSource) - Parameters:
message- mandatory message of this exceptioncause- optional propagated causeinterruptSource- optional propagated source ofThread.interrupt()call
-
SourcedInterruptedException
- Parameters:
cause- mandatory propagated causeinterruptSource- optional propagated source ofThread.interrupt()call
-
-
Method Details
-
wrap
Wraps the givenInterruptedExceptioninto aSourcedInterruptedExceptionif it is not yet of the desired type and if the current thread if aInterruptSource, i.e. the source is known.Otherwise the given
InterruptedExceptioninstance is returned.In case method is creating a new wrapping instance,
InterruptSource.clearInterruptSource()is being issued.- Parameters:
ie- the to be wrappedInterruptedException
-
wrap
Wraps the givenInterruptedExceptioninto aSourcedInterruptedExceptionif it is not yet of the same type and ifsourceis notnull.Otherwise the given
InterruptedExceptioninstance is returned.In case method is creating a new wrapping instance,
InterruptSource.clearInterruptSource()is being issued.- Parameters:
ie- the to be wrappedInterruptedExceptionsource- theInterruptSource
-
getInterruptSource
Returns the source of theThread.interrupt()call if known, otherwisenullis returned. -
getCause
Returns the propagatedInterruptedException, i.e. the cause of this exception, ornullif not applicable. -
toString
-
printCauseStack
Description copied from interface:ExceptionUtils.CustomStackTrace- Specified by:
printCauseStackin interfaceExceptionUtils.CustomStackTrace- Parameters:
s- output streamcauseStr- the cause titlecauseIdx- the cause index over all causes known by callerstackDepth- the maximum depth for stack entries, or-1for all
-
printStackTrace
Description copied from interface:ExceptionUtils.CustomStackTraceCustomprintStackTracemethod, similar toThrowable#printStackTrace(PrintStream, int, int).- Specified by:
printStackTracein interfaceExceptionUtils.CustomStackTrace- Parameters:
s- output streamcauseDepth- the maximum depth for causes, or-1for allstackDepth- the maximum depth for stack entries, or-1for all
-