openlsd.multiple.ophandler.common
Class LSDOpRunner

java.lang.Object
  extended by openlsd.multiple.ophandler.common.LSDOpRunner
All Implemented Interfaces:
java.lang.Runnable

public class LSDOpRunner
extends java.lang.Object
implements java.lang.Runnable

Class to run a thread for OpHandler

Author:
Frederic BREGIER LGPL 2007

Field Summary
protected  LSDDbAdmin admin
          DB Admin object
protected  boolean continueRunning
          Change by Shutdown force
protected  long delay
          Delay between two get in todo queue when no Op is available
protected  java.util.concurrent.Semaphore doneSignal
          Each OpRunner have done and have to wait to start
protected  LSDPoolLSDConnection poolLSDConnection
          Pool of connection
protected  java.util.concurrent.ConcurrentLinkedQueue<java.util.ArrayList<LSDDbOp>> queue
          Queue of Member to import
protected  java.util.concurrent.Semaphore startSignal
          Each OpRunner can start
 
Constructor Summary
LSDOpRunner(LSDDbAdmin admin, java.util.concurrent.ConcurrentLinkedQueue<java.util.ArrayList<LSDDbOp>> queue, long delay, LSDPoolLSDConnection poolLSDConnection, java.util.concurrent.Semaphore startSignal, java.util.concurrent.Semaphore doneSignal)
          Create one OpRunner
 
Method Summary
 void run()
           
 void runSequential()
          Sequential run (Delete present)
 void shutdownNow()
          Force shutdown if necessary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queue

protected java.util.concurrent.ConcurrentLinkedQueue<java.util.ArrayList<LSDDbOp>> queue
Queue of Member to import


admin

protected LSDDbAdmin admin
DB Admin object


delay

protected long delay
Delay between two get in todo queue when no Op is available


poolLSDConnection

protected LSDPoolLSDConnection poolLSDConnection
Pool of connection


startSignal

protected java.util.concurrent.Semaphore startSignal
Each OpRunner can start


doneSignal

protected java.util.concurrent.Semaphore doneSignal
Each OpRunner have done and have to wait to start


continueRunning

protected boolean continueRunning
Change by Shutdown force

Constructor Detail

LSDOpRunner

public LSDOpRunner(LSDDbAdmin admin,
                   java.util.concurrent.ConcurrentLinkedQueue<java.util.ArrayList<LSDDbOp>> queue,
                   long delay,
                   LSDPoolLSDConnection poolLSDConnection,
                   java.util.concurrent.Semaphore startSignal,
                   java.util.concurrent.Semaphore doneSignal)
Create one OpRunner

Parameters:
admin -
queue -
delay -
poolLSDConnection -
startSignal -
doneSignal -
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

runSequential

public void runSequential()
Sequential run (Delete present)

See Also:
Runnable.run()

shutdownNow

public void shutdownNow()
Force shutdown if necessary