Package org.apache.cassandra.concurrent
Interface TaskFactory
-
- All Known Implementing Classes:
TaskFactory.LocalAware
,TaskFactory.Standard
public interface TaskFactory
A simple mechanism to impose our desired semantics on the execution of a task without requiring a specialised executor service. We wrap tasks in a suitableFutureTask
or encapsulatingRunnable
.The encapsulations handle any exceptions in our standard way, as well as ensuring
ExecutorLocals
are propagated in the case oflocalAware()
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TaskFactory.LocalAware
static class
TaskFactory.Standard
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static TaskFactory
localAware()
static TaskFactory
standard()
java.lang.Runnable
toExecute(java.lang.Runnable runnable)
java.lang.Runnable
toExecute(WithResources withResources, java.lang.Runnable runnable)
<T> RunnableFuture<T>
toSubmit(java.lang.Runnable runnable)
<T> RunnableFuture<T>
toSubmit(java.lang.Runnable runnable, T result)
<T> RunnableFuture<T>
toSubmit(java.util.concurrent.Callable<T> callable)
<T> RunnableFuture<T>
toSubmit(WithResources withResources, java.lang.Runnable runnable)
<T> RunnableFuture<T>
toSubmit(WithResources withResources, java.lang.Runnable runnable, T result)
<T> RunnableFuture<T>
toSubmit(WithResources withResources, java.util.concurrent.Callable<T> callable)
-
-
-
Method Detail
-
toExecute
java.lang.Runnable toExecute(java.lang.Runnable runnable)
-
toSubmit
<T> RunnableFuture<T> toSubmit(java.lang.Runnable runnable)
-
toSubmit
<T> RunnableFuture<T> toSubmit(java.lang.Runnable runnable, T result)
-
toSubmit
<T> RunnableFuture<T> toSubmit(java.util.concurrent.Callable<T> callable)
-
toExecute
java.lang.Runnable toExecute(WithResources withResources, java.lang.Runnable runnable)
-
toSubmit
<T> RunnableFuture<T> toSubmit(WithResources withResources, java.lang.Runnable runnable)
-
toSubmit
<T> RunnableFuture<T> toSubmit(WithResources withResources, java.lang.Runnable runnable, T result)
-
toSubmit
<T> RunnableFuture<T> toSubmit(WithResources withResources, java.util.concurrent.Callable<T> callable)
-
standard
static TaskFactory standard()
-
localAware
static TaskFactory localAware()
-
-