@Internal public class TerminationContext extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private boolean |
cancelled |
private BatchLogObserver |
observer |
private java.lang.Thread |
runningThread |
private java.util.concurrent.CountDownLatch |
terminateLatch |
| Constructor and Description |
|---|
TerminationContext(BatchLogObserver observer) |
| Modifier and Type | Method and Description |
|---|---|
ObserveHandle |
asObserveHandle() |
void |
cancel()
Force cancellation of the observe.
|
void |
finished() |
void |
handleErrorCaught(java.lang.Throwable err,
java.lang.Runnable retry) |
boolean |
isCancelled() |
private void |
setCancelled() |
void |
setRunningThread()
Set the thread running the task to be terminated to the calling thread.
|
private final BatchLogObserver observer
private final java.util.concurrent.CountDownLatch terminateLatch
private volatile boolean cancelled
private volatile java.lang.Thread runningThread
public TerminationContext(BatchLogObserver observer)
public boolean isCancelled()
public void cancel()
public void setRunningThread()
public void finished()
public ObserveHandle asObserveHandle()
public void handleErrorCaught(java.lang.Throwable err,
java.lang.Runnable retry)
private void setCancelled()
Copyright © 2017–2021. All rights reserved.