ERXTaskThreadPoolExecutor Class Reference

Inherits java::util::concurrent::ThreadPoolExecutor.

Collaboration diagram for ERXTaskThreadPoolExecutor:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ERXTaskThreadPoolExecutor (int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue< Runnable > workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler)
 ERXTaskThreadPoolExecutor (int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue< Runnable > workQueue, RejectedExecutionHandler handler)
 ERXTaskThreadPoolExecutor (int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue< Runnable > workQueue, ThreadFactory threadFactory)
 ERXTaskThreadPoolExecutor (int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue< Runnable > workQueue)
Future<?> submit (Runnable task)

Protected Member Functions

void afterExecute (Runnable r, Throwable t)
void beforeExecute (Thread t, Runnable r)

Package Functions

public< T > Future< T > submit (Callable< T > task)
public< T > Future< T > submit (Runnable task, T result)

Static Private Attributes

static final Logger log = Logger.getLogger(ERXTaskThreadPoolExecutor.class)


Detailed Description

This is a custom ThreadPoolExecutor subclass whose purpose in life is (1) to ensure that we initialize ERXTaskThread status before task execution and reset status after execution, (2) use ERXFutureTask subclass of FutureTask so we have a reference to the wrapped task. (3) tell ERXEC to unlock all editing contexts in the background thread at the end of task execution.

This is accomplished by overriding the protected hook methods ThreadPoolExecutor#beforeExecute(Thread t, Runnable r) and ThreadPoolExecutor#afterExecute(Runnable r, Throwable t), and also the submit methods.

Author:
kieran

Constructor & Destructor Documentation

ERXTaskThreadPoolExecutor ( int  corePoolSize,
int  maximumPoolSize,
long  keepAliveTime,
TimeUnit  unit,
BlockingQueue< Runnable >  workQueue 
)

ERXTaskThreadPoolExecutor ( int  corePoolSize,
int  maximumPoolSize,
long  keepAliveTime,
TimeUnit  unit,
BlockingQueue< Runnable >  workQueue,
ThreadFactory  threadFactory 
)

ERXTaskThreadPoolExecutor ( int  corePoolSize,
int  maximumPoolSize,
long  keepAliveTime,
TimeUnit  unit,
BlockingQueue< Runnable >  workQueue,
RejectedExecutionHandler  handler 
)

ERXTaskThreadPoolExecutor ( int  corePoolSize,
int  maximumPoolSize,
long  keepAliveTime,
TimeUnit  unit,
BlockingQueue< Runnable >  workQueue,
ThreadFactory  threadFactory,
RejectedExecutionHandler  handler 
)


Member Function Documentation

void afterExecute ( Runnable  r,
Throwable  t 
) [protected]

void beforeExecute ( Thread  t,
Runnable  r 
) [protected]

public<T> Future<T> submit ( Callable< T >  task  )  [package]

public<T> Future<T> submit ( Runnable  task,
result 
) [package]

Future<?> submit ( Runnable  task  ) 


Member Data Documentation

final Logger log = Logger.getLogger(ERXTaskThreadPoolExecutor.class) [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:07 2012 for Project Wonder by  doxygen 1.5.8