public abstract class Executor extends Object implements Runnable
Modifier | Constructor and Description |
---|---|
protected |
Executor()
Constructs an Executor, with a default initial queue
size.
|
protected |
Executor(int queueSize)
Constructs an Executor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
callTask(Task task)
Calls and completes the task.
|
protected int |
getQueueSize()
Gets the current size of the queue.
|
protected void |
handleShutdown()
Handle a shutdown.
|
protected void |
interruptExecutingThread()
Interrupts the current executing thread.
|
protected boolean |
isRequestQueueEmpty()
Checks to see if the request queue is empty.
|
protected void |
logCallTaskException(Throwable t)
Logs details about an exception that occurred in callTask().
|
void |
run()
Runs this Executor.
|
void |
shutdown()
Shuts down this service.
|
protected void |
startThread()
Start a Thread that runs this instance.
|
void |
submit(Task task)
Posts a request to this Server.
|
protected Executor()
protected Executor(int queueSize)
queueSize
- initial queue sizeprotected void startThread()
Invoked in the static accessor in subclasses as the singleton instance is created.
protected void interruptExecutingThread()
public void shutdown()
public void submit(Task task)
task
- the task to be processed by this serviceprotected void handleShutdown() throws Exception
Exception
- if the operation failsprotected boolean isRequestQueueEmpty()
protected int getQueueSize()
protected void callTask(Task task)
Invokes call
and complete
on the
task.
task
- the task being executedprotected void logCallTaskException(Throwable t)
t
- the Exception that occurredCopyright © 2023. All rights reserved.