public class TaskQueueThread
extends java.lang.Thread
implements java.util.concurrent.Executor
Constructor and Description |
---|
TaskQueueThread(java.lang.String name,
int queueSize) |
TaskQueueThread(java.lang.String name,
int queueSize,
long timeoutMillis) |
Modifier and Type | Method and Description |
---|---|
void |
execute(java.lang.Runnable task)
Enqueue a task to run.
|
void |
execute(java.lang.Runnable task,
long timeoutMillis)
Enqueue a task to run.
|
void |
run() |
void |
shutdown()
Indicate that this task queue thread should finish running its enqueued
tasks and then exit.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public TaskQueueThread(java.lang.String name, int queueSize)
name
- name to give this threadqueueSize
- fixed size of queuepublic TaskQueueThread(java.lang.String name, int queueSize, long timeoutMillis)
name
- name to give this threadqueueSize
- fixed size of queuetimeoutMillis
- default maximum time to wait for queue to have an available slotpublic void execute(java.lang.Runnable task) throws java.util.concurrent.RejectedExecutionException
execute
in interface java.util.concurrent.Executor
task
- task to enqueuejava.util.concurrent.RejectedExecutionException
- if wait interrupted, timeout expires,
or shutdown has been calledpublic void execute(java.lang.Runnable task, long timeoutMillis) throws java.util.concurrent.RejectedExecutionException
task
- task to enqueuetimeoutMillis
- maximum time to wait for queue to have an available slotjava.util.concurrent.RejectedExecutionException
- if wait interrupted, timeout expires,
or shutdown has been calledpublic void shutdown()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.