18 #ifndef _DECAF_UTIL_CONCURRENT_EXECUTORSERVICE_H_ 19 #define _DECAF_UTIL_CONCURRENT_EXECUTORSERVICE_H_ 33 namespace concurrent {
76 virtual bool awaitTermination(
long long timeout,
const TimeUnit& unit) = 0;
83 virtual void shutdown() = 0;
102 virtual bool isShutdown()
const = 0;
109 virtual bool isTerminated()
const = 0;
142 this->doSubmit(newTask.
get());
147 return proxy.release();
151 ex.
setMark(__FILE__, __LINE__);
190 this->doSubmit(newTask.
get());
195 return proxy.release();
199 ex.
setMark(__FILE__, __LINE__);
236 this->doSubmit(newTask.
get());
241 return proxy.release();
245 ex.
setMark(__FILE__, __LINE__);
263 virtual void doSubmit(
FutureType* future) = 0;
#define DECAF_CATCH_RETHROW(type)
Macro for catching and rethrowing an exception of a given type.
Definition: ExceptionDefines.h:27
Definition: RejectedExecutionException.h:31
An object that executes submitted decaf.lang.Runnable tasks.
Definition: Executor.h:87
An Executor that provides methods to manage termination and methods that can produce a Future for tra...
Definition: ExecutorService.h:56
A cancellable asynchronous computation.
Definition: FutureTask.h:58
Future< E > * submit(decaf::lang::Runnable *task, const E &result, bool takeOwnership=true)
Submits a Runnable task for execution and returns a Future representing that task.
Definition: ExecutorService.h:178
T * release()
Releases the Pointer held and resets the internal pointer value to Null.
Definition: Pointer.h:174
A TimeUnit represents time durations at a given unit of granularity and provides utility methods to c...
Definition: TimeUnit.h:62
Future< E > * submit(decaf::lang::Runnable *task, bool takeOwnership=true)
Submits a Runnable object for execution.
Definition: ExecutorService.h:224
Future< E > * submit(Callable< E > *task, bool takeOwnership=true)
Submits a value-returning task for execution and returns a Future pointer representing the pending re...
Definition: ExecutorService.h:130
PointerType get() const
Gets the real pointer that is contained within this Pointer.
Definition: Pointer.h:188
#define DECAF_CATCHALL_THROW(type)
A catch-all that throws a known exception.
Definition: ExceptionDefines.h:50
Definition: NullPointerException.h:32
#define DECAF_API
Definition: Config.h:29
Definition: ArrayList.h:39
A Future represents the result of an asynchronous computation.
Definition: Future.h:88
Interface for a runnable object - defines a task that can be run by a thread.
Definition: Runnable.h:29
Definition: Exception.h:38
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 void setMark(const char *file, const int lineNumber)
Adds a file/line number to the stack trace.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25
virtual ~ExecutorService()
Definition: ExecutorService.h:59