public static interface CacheStorage.MultiThreadedContext
Modifier and Type | Method and Description |
---|---|
void |
abortOnException(Throwable ex)
If an exception cannot be handled, this method aborts the operation and
propagates the exception to the operation client.
|
void |
awaitTermination()
If threads are started by using
getExecutorService() waits for termination
or tries to stop threads immediately if shouldStop() is true. |
ExecutorService |
getExecutorService()
A private executor service for this operation to run in multiple threads.
|
boolean |
shouldStop()
True if the operation should stop immediately.
|
ExecutorService getExecutorService()
ExecutorService.awaitTermination(long, java.util.concurrent.TimeUnit)
()}
waits only for threads started within the visit operation. Multiple calls to
this method return the identical instance.
When using Callable
a thrown exception in within the
task leads to an abort of the operation, see abortOnException(Throwable)
.
The methods
ExecutorService.invokeAll(java.util.Collection, long, java.util.concurrent.TimeUnit)
,
ExecutorService.invokeAny(java.util.Collection)
,
ExecutorService.invokeAny(java.util.Collection, long, java.util.concurrent.TimeUnit)
are or may not be supported by the provided implementation.
void awaitTermination() throws InterruptedException
getExecutorService()
waits for termination
or tries to stop threads immediately if shouldStop()
is true. This is also done
automatically when the visit method exists.InterruptedException
boolean shouldStop()
void abortOnException(Throwable ex)
shouldStop()
is true.cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.