public class UncheckedInterruptedException extends UncheckedGrinderException
InterruptedException
s and InterruptedIOException
s
easier to propagate.
Our policy on interrupt handling:
Thread.interrupt()
and ThreadGroup.interrupt()
are used
in shut down code. We can't simply swallow InterruptedException
s.
InterruptedException
which it
doesn't know how to handle, it rethrows it in an
UncheckedInterruptedException
.InterruptibleRunnable.interruptibleRun()
implementations are carefully reviewed to ensure that they do not ignore the
interrupt condition and will exit whenever InterruptedException
and
InterruptedIOException
s are received. We only interrupt code that
implements
InterruptibleRunnable.interruptibleRun()
.
UncheckedInterruptedException
s.InterruptibleRunnable
catches an
IOException
, it calls ioException(IOException)
, which will
throw an UncheckedInterruptedException
if necessary.InterruptedException
s. This doesn't
matter as we should never interrupt this code.Constructor and Description |
---|
UncheckedInterruptedException(InterruptedException e)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
ioException(IOException e)
InterruptedIOException s are a pain to handle as they extend
IOException . |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public UncheckedInterruptedException(InterruptedException e)
e
- The original InterruptedException.public static void ioException(IOException e)
InterruptedIOException
s are a pain to handle as they extend
IOException
. IOException
handlers should call this, unless
they are part of an InterruptibleRunnable
and know what they're doing.e
- An IOException
.Copyright © 2000-2014. All Rights Reserved.