Top Description Inners Fields Constructors Methods
org.hsqldb.lib

public Class HsqlTaskQueue

extends Object
Class Inheritance

Provides very simple queued execution of Runnable objects in a background thread. The underlying queue is an HsqlDeque instance, an array-based circular queue implementation with automatic capacity expansion.
Author
Campbell Burnet (campbell-burnet@users dot sourceforge.net)
Since
1.7.2
Version
2.6.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class

Field Summary

Modifier and TypeField and Description
protected volatile boolean
isShutdown

true if thread should shut down after processing current task.

protected final HsqlDeque<Runnable>
protected static final Runnable
SHUTDOWNTASK

Special queue element to signal termination

protected final HsqlTaskQueue.TaskRunner
protected Thread
taskRunnerThread

The thread used to process commands

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected synchronized void
public void
execute(Runnable command)

public synchronized Thread
public boolean
public synchronized void
public synchronized void
public synchronized void
public synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isShutdownback to summary
protected volatile boolean isShutdown

true if thread should shut down after processing current task. Once set true, stays true forever

queueback to summary
protected final HsqlDeque<Runnable> queue
SHUTDOWNTASKback to summary
protected static final Runnable SHUTDOWNTASK

Special queue element to signal termination

taskRunnerback to summary
protected final HsqlTaskQueue.TaskRunner taskRunner
taskRunnerThreadback to summary
protected Thread taskRunnerThread

The thread used to process commands

Constructor Detail

HsqlTaskQueueback to summary
public HsqlTaskQueue()

Method Detail

clearThreadback to summary
protected synchronized void clearThread()
executeback to summary
public void execute(Runnable command) throws RuntimeException
getTaskRunnerThreadback to summary
public synchronized Thread getTaskRunnerThread()
isShutdownback to summary
public boolean isShutdown()
restartback to summary
public synchronized void restart()
shutdownAfterCurrentback to summary
public synchronized void shutdownAfterCurrent()
shutdownAfterQueuedback to summary
public synchronized void shutdownAfterQueued()
shutdownImmediatelyback to summary
public synchronized void shutdownImmediately()
org.hsqldb.lib back to summary

protected Class HsqlTaskQueue.TaskRunner

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TaskRunnerback to summary
protected TaskRunner()

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.