public class ExceptionProxy extends Object
| Constructor and Description |
|---|
ExceptionProxy(Thread toInterrupt)
Creates an exception proxy that interrupts the given thread upon
report of an exception.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkAndThrowException()
Checks whether an exception has been set via
reportError(Throwable). |
void |
reportError(Throwable t)
Sets the exception and interrupts the target thread,
if no other exception has occurred so far.
|
public void reportError(Throwable t)
The exception is only set (and the interruption is only triggered), if no other exception was set before.
t - The exception that occurredpublic void checkAndThrowException()
throws Exception
reportError(Throwable).
If yes, that exception if re-thrown by this method.Exception - This method re-throws the exception, if set.Copyright © 2019–2021 The Apache Software Foundation. All rights reserved.