|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.AbstractExecutorService
org.multiverse.transactional.executors.TransactionalThreadPoolExecutor
public final class TransactionalThreadPoolExecutor
A transactional Executor implementation that looks a lot like the
ThreadPoolExecutor.
ThreadPoolExecutor.afterExecute(Runnable, Throwable) but this functionality isn't
provided yet. So the best thing that you can do is wrap the command in a logging Runnable that catches and
logs the exception.
A task executed by a TransactionalThreadPoolExecutor will not automatically receive its own transaction.
| Constructor Summary | |
|---|---|
TransactionalThreadPoolExecutor()
Creates a new single threaded TransactionalThreadPoolExecutor with bounded workqueue with 1000.000 items and relaxed maximum capacity (so the actual size could exceed the maximum capacity for increased concurrency; takes and puts on the queue can happen concurrently without conflicting) If no limit is placed on the workQueue is could lead to a system not degrading gracefull because it runs out of memory instead of rejecting tasks. |
|
TransactionalThreadPoolExecutor(int poolSize)
Creates a new TransactionalThreadPoolExecutor with bounded workqueue with 1000.000 items and relaxed maximum capacity (so the actual size could exceed the maximum capacity for increased concurrency; takes and puts on the queue can happen concurrently without conflicting) |
|
TransactionalThreadPoolExecutor(TransactionalQueue<Runnable> workQueue)
Creates a new TransactionalThreadPoolExecutor with the given workQueue and 1 as corePoolSize and maxPoolSize. |
|
TransactionalThreadPoolExecutor(TransactionalQueue<Runnable> workQueue,
int corePoolSize)
Creates a new TransactionalThreadPoolExecutor. |
|
| Method Summary | |
|---|---|
void |
awaitTermination()
Awaits for this TransactionalThreadPoolExecutor to complete. |
boolean |
awaitTermination(long timeout,
TimeUnit unit)
|
void |
awaitTerminationUninterruptibly()
Awaits for this TransactionalThreadPoolExecutor to complete without the possibility of being interrupted. |
void |
execute(Runnable command)
|
int |
getCorePoolSize()
Returns the minimum number of threads in this TransactionalThreadPoolExecutor. |
int |
getCurrentPoolSize()
Returns the current number of threads in this TransactionalThreadPoolExecutor. |
org.multiverse.transactional.executors.TransactionalThreadPoolExecutor.State |
getState()
Returns the State this TransactionalThreadPoolExecutor has. |
ThreadFactory |
getThreadFactory()
Returns the thread factory used to createReference new threads. |
BlockingQueue<Runnable> |
getWorkQueue()
Returns the BlockingQueue this TransactionalThreadPoolExecutor uses to store unprocessed work. |
boolean |
isShutdown()
|
boolean |
isStarted()
|
boolean |
isTerminated()
|
void |
setCorePoolSize(int newCorePoolSize)
Sets the corePoolSize of this TransactionalThreadPoolExecutor. |
void |
setThreadFactory(ThreadFactory threadFactory)
Sets the thread factory used to createReference new threads. |
void |
shutdown()
|
List<Runnable> |
shutdownNow()
|
void |
start()
Starts this TransactionalThreadPoolExecutor. |
void |
u()
|
void |
v()
|
void |
x(int a)
|
void |
y(int b)
|
| Methods inherited from class java.util.concurrent.AbstractExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionalThreadPoolExecutor()
public TransactionalThreadPoolExecutor(int poolSize)
poolSize - the maximum and core poolsize.
IllegalArgumentException - if poolSize smaller than 0.public TransactionalThreadPoolExecutor(TransactionalQueue<Runnable> workQueue)
workQueue - the BlockingQueue to store unprocessed work.
NullPointerException - if workQueue is null.
public TransactionalThreadPoolExecutor(TransactionalQueue<Runnable> workQueue,
int corePoolSize)
workQueue - the BlockingQueue to store unprocessed work.corePoolSize - the minimum number of threads in this TransactionalThreadPoolExecutor.
NullPointerException - if workQueue is null.
IllegalArgumentException - if corePoolSize is smaller than zero or if maxPoolSize smaller than
corePoolSize.| Method Detail |
|---|
public int getCorePoolSize()
public void setCorePoolSize(int newCorePoolSize)
newCorePoolSize - the new core poolsize.
IllegalArgumentException - if newCorePoolSize is smaller than 0.
IllegalStateException - if this TransactionalThreadPoolExecutor is shutdown or terminated.public int getCurrentPoolSize()
public BlockingQueue<Runnable> getWorkQueue()
public org.multiverse.transactional.executors.TransactionalThreadPoolExecutor.State getState()
public void setThreadFactory(ThreadFactory threadFactory)
threadFactory - the new thread factory
NullPointerException - if threadFactory is nullgetThreadFactory()public ThreadFactory getThreadFactory()
setThreadFactory(java.util.concurrent.ThreadFactory)public void shutdown()
public List<Runnable> shutdownNow()
public boolean isShutdown()
public boolean isTerminated()
public boolean isStarted()
public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
InterruptedException
public void awaitTermination()
throws InterruptedException
InterruptedException - if the Thread was interrupted.public void awaitTerminationUninterruptibly()
public void execute(Runnable command)
public void u()
public void v()
public void x(int a)
public void y(int b)
public void start()
IllegalStateException - if the this TransactionalThreadPoolExecutor already is shutdown or terminated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||