jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Public Member Functions | Static Public Member Functions | List of all members
org.jau.lang.SourcedInterruptedException Class Reference

InterruptedException, which may include the source, see getInterruptSource(). More...

Inheritance diagram for org.jau.lang.SourcedInterruptedException:
Collaboration diagram for org.jau.lang.SourcedInterruptedException:

Public Member Functions

 SourcedInterruptedException (final String message, final InterruptedException cause, final Throwable interruptSource)
 
 SourcedInterruptedException (final InterruptedException cause, final Throwable interruptSource)
 
final Throwable getInterruptSource ()
 Returns the source of the Thread#interrupt() call if known, otherwise null is returned. More...
 
InterruptedException getCause ()
 Returns the propagated InterruptedException, i.e. More...
 
String toString ()
 
final void printCauseStack (final PrintStream s, final String causeStr, final int causeIdx, final int stackDepth)
 Prints this Throwable as a cause to the output PrintStream s, not iterating over all inner causes! More...
 
final void printStackTrace (final PrintStream s, final int causeDepth, final int stackDepth)
 Custom printStackTrace method, similar to Throwable#printStackTrace(PrintStream, int, int). More...
 
void printCauseStack (final PrintStream s, final String causeStr, final int causeIdx, final int stackDepth)
 Prints this Throwable as a cause to the output PrintStream s, not iterating over all inner causes! More...
 
void printStackTrace (final PrintStream s, final int causeDepth, final int stackDepth)
 Custom printStackTrace method, similar to Throwable#printStackTrace(PrintStream, int, int). More...
 

Static Public Member Functions

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. More...
 
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. More...
 

Detailed Description

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
0.3.0

Definition at line 42 of file SourcedInterruptedException.java.

Constructor & Destructor Documentation

◆ SourcedInterruptedException() [1/2]

org.jau.lang.SourcedInterruptedException.SourcedInterruptedException ( final String  message,
final InterruptedException  cause,
final Throwable  interruptSource 
)
Parameters
messagemandatory message of this exception
causeoptional propagated cause
interruptSourceoptional propagated source of Thread#interrupt() call

Definition at line 90 of file SourcedInterruptedException.java.

◆ SourcedInterruptedException() [2/2]

org.jau.lang.SourcedInterruptedException.SourcedInterruptedException ( final InterruptedException  cause,
final Throwable  interruptSource 
)
Parameters
causemandatory propagated cause
interruptSourceoptional propagated source of Thread#interrupt() call

Definition at line 102 of file SourcedInterruptedException.java.

Member Function Documentation

◆ getCause()

InterruptedException org.jau.lang.SourcedInterruptedException.getCause ( )

Returns the propagated InterruptedException, i.e.

the cause of this exception, or null if not applicable.

Definition at line 124 of file SourcedInterruptedException.java.

◆ getInterruptSource()

final Throwable org.jau.lang.SourcedInterruptedException.getInterruptSource ( )

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

Definition at line 112 of file SourcedInterruptedException.java.

◆ printCauseStack()

final void org.jau.lang.SourcedInterruptedException.printCauseStack ( final PrintStream  s,
final String  causeStr,
final int  causeIdx,
final int  stackDepth 
)

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

Parameters
soutput stream
causeStrthe cause title
causeIdxthe cause index over all causes known by caller
stackDepththe maximum depth for stack entries, or -1 for all
Since
0.3.0

Implements org.jau.lang.ExceptionUtils.CustomStackTrace.

Definition at line 145 of file SourcedInterruptedException.java.

Here is the call graph for this function:

◆ printStackTrace()

final void org.jau.lang.SourcedInterruptedException.printStackTrace ( final PrintStream  s,
final int  causeDepth,
final int  stackDepth 
)

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

Parameters
soutput stream
causeDepththe maximum depth for causes, or -1 for all
stackDepththe maximum depth for stack entries, or -1 for all

Implements org.jau.lang.ExceptionUtils.CustomStackTrace.

Definition at line 155 of file SourcedInterruptedException.java.

Here is the call graph for this function:

◆ toString()

String org.jau.lang.SourcedInterruptedException.toString ( )

Definition at line 129 of file SourcedInterruptedException.java.

◆ wrap() [1/2]

static InterruptedException org.jau.lang.SourcedInterruptedException.wrap ( final InterruptedException  ie)
static

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
iethe to be wrapped InterruptedException

Definition at line 59 of file SourcedInterruptedException.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wrap() [2/2]

static InterruptedException org.jau.lang.SourcedInterruptedException.wrap ( final InterruptedException  ie,
final InterruptSource  source 
)
static

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
iethe to be wrapped InterruptedException
sourcethe InterruptSource

Definition at line 77 of file SourcedInterruptedException.java.

Here is the call graph for this function:

The documentation for this class was generated from the following file: