17 #ifndef _DECAF_UTIL_CONCURRENT_THREADPOOLEXECUTOR_H_ 18 #define _DECAF_UTIL_CONCURRENT_THREADPOOLEXECUTOR_H_ 66 friend class ExecutorKernel;
67 ExecutorKernel* kernel;
98 long long keepAliveTime,
const TimeUnit& unit,
132 long long keepAliveTime,
const TimeUnit& unit,
167 long long keepAliveTime,
const TimeUnit& unit,
206 long long keepAliveTime,
const TimeUnit& unit,
217 virtual void shutdown();
223 virtual bool isShutdown()
const;
225 virtual bool isTerminated()
const;
232 virtual int getPoolSize()
const;
239 virtual int getCorePoolSize()
const;
254 virtual void setCorePoolSize(
int poolSize);
261 virtual int getMaximumPoolSize()
const;
274 virtual void setMaximumPoolSize(
int maxSize);
283 virtual long long getTaskCount()
const;
291 virtual int getActiveCount()
const;
299 virtual long long getCompletedTaskCount()
const;
307 virtual int getLargestPoolSize()
const;
327 virtual bool isTerminating()
const;
341 virtual void allowCoreThreadTimeout(
bool value);
351 virtual bool allowsCoreThreadTimeout()
const;
362 virtual long long getKeepAliveTime(
const TimeUnit& unit)
const;
377 virtual void setKeepAliveTime(
long long timeout,
const TimeUnit& unit);
427 virtual bool prestartCoreThread();
436 virtual int prestartAllCoreThreads();
456 virtual void purge();
496 virtual void terminated();
503 virtual void onShutdown();
547 if (executer->isShutdown()) {
Provides a default implementation for the methods of the ExecutorService interface.
Definition: AbstractExecutorService.h:37
AbortPolicy()
Definition: ThreadPoolExecutor.h:516
This class represents an error that has occurred.
Definition: Throwable.h:44
A decaf::util::Queue that additionally supports operations that wait for the queue to become non-empt...
Definition: BlockingQueue.h:164
Handler policy for tasks that are rejected upon a call to ThreadPoolExecutor::execute this class alwa...
Definition: ThreadPoolExecutor.h:568
Definition: RejectedExecutionException.h:31
#define NULL
Definition: Config.h:33
Handler policy for tasks that are rejected upon a call to ThreadPoolExecutor::execute this class alwa...
Definition: ThreadPoolExecutor.h:590
public interface ThreadFactory
Definition: ThreadFactory.h:52
virtual ~DiscardPolicy()
Definition: ThreadPoolExecutor.h:574
CallerRunsPolicy()
Definition: ThreadPoolExecutor.h:539
virtual ~AbortPolicy()
Definition: ThreadPoolExecutor.h:519
virtual void rejectedExecution(decaf::lang::Runnable *task, ThreadPoolExecutor *executer DECAF_UNUSED)
Definition: ThreadPoolExecutor.h:545
A TimeUnit represents time durations at a given unit of granularity and provides utility methods to c...
Definition: TimeUnit.h:62
virtual BlockingQueue< decaf::lang::Runnable * > * getQueue()
Provides access to the Task Queue used by this Executor.
virtual ~CallerRunsPolicy()
Definition: ThreadPoolExecutor.h:542
Defines a Thread Pool object that implements the functionality of pooling threads to perform user tas...
Definition: ThreadPoolExecutor.h:58
A handler for tasks that cannot be executed by a ThreadPoolExecutor.
Definition: RejectedExecutionHandler.h:36
A Thread is a concurrent unit of execution.
Definition: Thread.h:64
#define DECAF_API
Definition: Config.h:29
Definition: ArrayList.h:39
#define DECAF_UNUSED
Definition: Config.h:160
Interface for a runnable object - defines a task that can be run by a thread.
Definition: Runnable.h:29
virtual void rejectedExecution(decaf::lang::Runnable *task, ThreadPoolExecutor *executer)
Method that may be invoked by a ThreadPoolExecutor when execute cannot accept a task.
Definition: ThreadPoolExecutor.h:599
virtual void rejectedExecution(decaf::lang::Runnable *task, ThreadPoolExecutor *executer DECAF_UNUSED)
Definition: ThreadPoolExecutor.h:577
Definition: Exception.h:38
DiscardPolicy()
Definition: ThreadPoolExecutor.h:571
Handler policy for tasks that are rejected upon a call to ThreadPoolExecutor::execute this class will...
Definition: ThreadPoolExecutor.h:536
virtual void execute(decaf::lang::Runnable *task)
This method is the same as calling the two param execute method and passing true as the second argume...
virtual void rejectedExecution(decaf::lang::Runnable *task, ThreadPoolExecutor *executer DECAF_UNUSED)
Definition: ThreadPoolExecutor.h:522
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
virtual ~DiscardOldestPolicy()
Definition: ThreadPoolExecutor.h:596
Handler policy for tasks that are rejected upon a call to ThreadPoolExecutor::execute this class alwa...
Definition: ThreadPoolExecutor.h:513
virtual void run()=0
Run method - called by the Thread class in the context of the thread.
DiscardOldestPolicy()
Definition: ThreadPoolExecutor.h:593
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25
virtual bool isShutdown() const
Returns whether this executor has been shutdown or not.