Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hsqldb
Class TriggerDef  view TriggerDef download TriggerDef.java

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.hsqldb.TriggerDef
All Implemented Interfaces:
java.lang.Runnable

class TriggerDef
extends java.lang.Thread

TriggerDef class declaration Definition and execution of triggers Development of the trigger implementation sponsored by Logicscope Realisations Ltd

Version:
1.7.0 (1.0.0.3) Revision History: 1.0.0.1 First release in hsqldb 1.61 1.0.0.2 'nowait' support to prevent deadlock 1.0.0.3 multiple row queue for each trigger

Nested Class Summary
 
Nested classes inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected static int defaultQueueSize
           
(package private) static int DELETE_AFTER
           
(package private) static int DELETE_AFTER_ROW
           
(package private) static int DELETE_BEFORE
           
(package private) static int DELETE_BEFORE_ROW
           
(package private)  java.lang.String fire
           
(package private)  boolean forEachRow
           
(package private) static int INSERT_AFTER
           
(package private) static int INSERT_AFTER_ROW
           
(package private) static int INSERT_BEFORE
           
(package private) static int INSERT_BEFORE_ROW
           
(package private)  int maxRowsQueued
           
(package private)  java.lang.String name
           
(package private)  boolean nowait
           
(package private) static int NUM_TRIGGER_OPS
          member variables
(package private) static int NUM_TRIGS
           
(package private)  java.lang.String operation
           
protected  org.hsqldb.lib.HsqlDeque pendingQueue
           
protected  int rowsQueued
           
(package private)  Table table
           
(package private)  Trigger trig
           
(package private) static int UPDATE_AFTER
           
(package private) static int UPDATE_AFTER_ROW
           
(package private) static int UPDATE_BEFORE
           
(package private) static int UPDATE_BEFORE_ROW
           
protected  boolean valid
           
(package private)  int vectorIndx
           
(package private)  java.lang.String when
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TriggerDef(java.lang.String sName, java.lang.String sWhen, java.lang.String sOper, boolean bForEach, Table pTab, Trigger pTrig, java.lang.String sFire, boolean bNowait, int nQueueSize)
          Constructor declaration create an object from the components of an SQL CREATE TRIGGER statement
 
Method Summary
static int getDefaultQueueSize()
           
 boolean isBusy()
          Method declaration
 boolean isValid()
          Method declaration
static int numTrigs()
          Method declaration
(package private)  java.lang.Object[] pop()
          pop method declaration
(package private)  void push(java.lang.Object[] row)
          push method declaration
 void run()
          run method declaration
 int SqlToIndex()
          SqlToIndex method declaration
 java.lang.StringBuffer toBuf()
          Method declaration
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NUM_TRIGGER_OPS

static final int NUM_TRIGGER_OPS
member variables

See Also:
Constant Field Values

NUM_TRIGS

static final int NUM_TRIGS
See Also:
Constant Field Values

INSERT_AFTER

static final int INSERT_AFTER
See Also:
Constant Field Values

DELETE_AFTER

static final int DELETE_AFTER
See Also:
Constant Field Values

UPDATE_AFTER

static final int UPDATE_AFTER
See Also:
Constant Field Values

INSERT_BEFORE

static final int INSERT_BEFORE
See Also:
Constant Field Values

DELETE_BEFORE

static final int DELETE_BEFORE
See Also:
Constant Field Values

UPDATE_BEFORE

static final int UPDATE_BEFORE
See Also:
Constant Field Values

INSERT_AFTER_ROW

static final int INSERT_AFTER_ROW
See Also:
Constant Field Values

DELETE_AFTER_ROW

static final int DELETE_AFTER_ROW
See Also:
Constant Field Values

UPDATE_AFTER_ROW

static final int UPDATE_AFTER_ROW
See Also:
Constant Field Values

INSERT_BEFORE_ROW

static final int INSERT_BEFORE_ROW
See Also:
Constant Field Values

DELETE_BEFORE_ROW

static final int DELETE_BEFORE_ROW
See Also:
Constant Field Values

UPDATE_BEFORE_ROW

static final int UPDATE_BEFORE_ROW
See Also:
Constant Field Values

name

java.lang.String name

when

java.lang.String when

operation

java.lang.String operation

forEachRow

boolean forEachRow

nowait

boolean nowait

maxRowsQueued

int maxRowsQueued

defaultQueueSize

protected static int defaultQueueSize

table

Table table

trig

Trigger trig

fire

java.lang.String fire

vectorIndx

int vectorIndx

pendingQueue

protected org.hsqldb.lib.HsqlDeque pendingQueue

rowsQueued

protected int rowsQueued

valid

protected boolean valid
Constructor Detail

TriggerDef

public TriggerDef(java.lang.String sName,
                  java.lang.String sWhen,
                  java.lang.String sOper,
                  boolean bForEach,
                  Table pTab,
                  Trigger pTrig,
                  java.lang.String sFire,
                  boolean bNowait,
                  int nQueueSize)
Constructor declaration create an object from the components of an SQL CREATE TRIGGER statement

Method Detail

getDefaultQueueSize

public static int getDefaultQueueSize()

toBuf

public java.lang.StringBuffer toBuf()
Method declaration


SqlToIndex

public int SqlToIndex()
SqlToIndex method declaration

Given the SQL creating the trigger, say what the index to the Vector[] is


run

public void run()
run method declaration

the trigger JSP is run in its own thread here. Its job is simply to wait until it is told by the main thread that it should fire the trigger.


pop

java.lang.Object[] pop()
pop method declaration

The consumer (trigger) thread waits for an event to be queued

Note: This push/pop pairing assumes a single producer thread and a single consumer thread _only_.


push

void push(java.lang.Object[] row)
push method declaration

The main thread tells the trigger thread to fire by this call


numTrigs

public static int numTrigs()
Method declaration


isBusy

public boolean isBusy()
Method declaration


isValid

public boolean isValid()
Method declaration