Top Description Fields Constructors Methods
com.jogamp.common.util

public Class SourcedInterruptedException

extends InterruptedException
implements CustomStackTrace
Class Inheritance
All Implemented Interfaces
com.jogamp.common.ExceptionUtils.CustomStackTrace
Annotations
@SuppressWarnings:serial
Imports
java.io.PrintStream, com.jogamp.common.ExceptionUtils, .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

Field Summary

Modifier and TypeField and Description
pack-priv final Throwable

Constructor Summary

AccessConstructor and Description
public
SourcedInterruptedException(final String
mandatory message of this exception
message
,
final InterruptedException
optional propagated cause
cause
,
final Throwable
optional propagated source of Thread#interrupt() call
interruptSource
)

public
SourcedInterruptedException(final InterruptedException
mandatory propagated cause
cause
,
final Throwable
optional propagated source of Thread#interrupt() call
interruptSource
)

Method Summary

Modifier and TypeMethod and Description
public InterruptedException
getCause()

Overrides java.lang.Throwable.getCause.

Returns the propagated InterruptedException, i.e. the cause of this exception, or null if not applicable.
public final Throwable
getInterruptSource()

Returns the source of the Thread#interrupt() call if known, otherwise null is returned.

public final void
printCauseStack(final PrintStream
output stream
s
,
final String
the cause title
causeStr
,
final int
the cause index over all causes known by caller
causeIdx
,
final int
the maximum depth for stack entries, or -1 for all
stackDepth
)

Implements com.jogamp.common.ExceptionUtils.CustomStackTrace.printCauseStack.

Prints this Throwable as a cause to the output PrintStream s, not iterating over all inner causes!
public final void
printStackTrace(final PrintStream
output stream
s
,
final int
the maximum depth for causes, or -1 for all
causeDepth
,
final int
the maximum depth for stack entries, or -1 for all
stackDepth
)

Implements com.jogamp.common.ExceptionUtils.CustomStackTrace.printStackTrace.

Custom printStackTrace method, similar to Throwable#printStackTrace(PrintStream, int, int).
public String
toString()

Overrides java.lang.Throwable.toString.

Returns a short description of this throwable.
public static InterruptedException
wrap(final InterruptedException
the to be wrapped InterruptedException
ie
)

Wraps the given InterruptedException into a SourcedInterruptedException if it is not yet of the desired type and if the current thread if a InterruptSource, i.e. the source is known.

public static InterruptedException
wrap(final InterruptedException
the to be wrapped InterruptedException
ie
,
final InterruptSource source)

Wraps the given InterruptedException into a SourcedInterruptedException if it is not yet of the same type and if source is not null.

Field Detail

interruptSourceback to summary
pack-priv final Throwable interruptSource

Constructor Detail

SourcedInterruptedExceptionback to summary
public SourcedInterruptedException(final String message, final InterruptedException cause, final Throwable interruptSource)
Parameters
message:String

mandatory message of this exception

cause:InterruptedException

optional propagated cause

interruptSource:Throwable

optional propagated source of Thread#interrupt() call

SourcedInterruptedExceptionback to summary
public SourcedInterruptedException(final InterruptedException cause, final Throwable interruptSource)
Parameters
cause:InterruptedException

mandatory propagated cause

interruptSource:Throwable

optional propagated source of Thread#interrupt() call

Method Detail

getCauseback to summary
public InterruptedException getCause()

Overrides java.lang.Throwable.getCause.

Doc from java.lang.Throwable.getCause.

Returns the propagated InterruptedException, i.e. the cause of this exception, or null if not applicable.

Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

This implementation returns the cause that was supplied via one of the constructors requiring a Throwable, or that was set after creation with the initCause(Throwable) method. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means. This is appropriate for a "legacy chained throwable" that predates the addition of chained exceptions to Throwable. Note that it is not necessary to override any of the PrintStackTrace methods, all of which invoke the getCause method to determine the cause of a throwable.

Returns:InterruptedException

the cause of this throwable or null if the cause is nonexistent or unknown.

Annotations
@Override
getInterruptSourceback to summary
public final Throwable getInterruptSource()

Returns the source of the Thread#interrupt() call if known, otherwise null is returned.

printCauseStackback to summary
public final void printCauseStack(final PrintStream s, final String causeStr, final int causeIdx, final int stackDepth)

Implements com.jogamp.common.ExceptionUtils.CustomStackTrace.printCauseStack.

Doc from com.jogamp.common.ExceptionUtils.CustomStackTrace.printCauseStack.

Prints this Throwable as a cause to the output PrintStream s, not iterating over all inner causes!

Parameters
s:PrintStream

output stream

causeStr:String

the cause title

causeIdx:int

the cause index over all causes known by caller

stackDepth:int

the maximum depth for stack entries, or -1 for all

Annotations
@Override
printStackTraceback to summary
public final void printStackTrace(final PrintStream s, final int causeDepth, final int stackDepth)

Implements com.jogamp.common.ExceptionUtils.CustomStackTrace.printStackTrace.

Doc from com.jogamp.common.ExceptionUtils.CustomStackTrace.printStackTrace.

Custom printStackTrace method, similar to Throwable#printStackTrace(PrintStream, int, int).

Parameters
s:PrintStream

output stream

causeDepth:int

the maximum depth for causes, or -1 for all

stackDepth:int

the maximum depth for stack entries, or -1 for all

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

Doc from java.lang.Throwable.toString.

Returns a short description of this throwable. The result is the concatenation of:

  • the name of the class of this object
  • ": " (a colon and a space)
  • the result of invoking this object's getLocalizedMessage method
If getLocalizedMessage returns null, then just the class name is returned.
Returns:String

a string representation of this throwable.

Annotations
@Override
wrapback to summary
public static InterruptedException wrap(final InterruptedException ie)

Wraps the given InterruptedException into a SourcedInterruptedException if it is not yet of the desired type and if the current thread if a InterruptSource, i.e. the source is known.

Otherwise the given InterruptedException instance is returned.

In case method is creating a new wrapping instance, InterruptSource#clearInterruptSource() is being issued.

Parameters
ie:InterruptedException

the to be wrapped InterruptedException

wrapback to summary
public static InterruptedException wrap(final InterruptedException ie, final InterruptSource source)

Wraps the given InterruptedException into a SourcedInterruptedException if it is not yet of the same type and if source is not null.

Otherwise the given InterruptedException instance is returned.

In case method is creating a new wrapping instance, InterruptSource#clearInterruptSource() is being issued.

Parameters
ie:InterruptedException

the to be wrapped InterruptedException

source:InterruptSource

the InterruptSource