org.ow2.orchestra.pvm.internal.jobexecutor
Class AbstractDispatcherThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.ow2.orchestra.pvm.internal.jobexecutor.AbstractDispatcherThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
DispatcherThread, JdkDispatcherThread

public abstract class AbstractDispatcherThread
extends Thread

Common part of dispatcher thread implementations. This thread is responsible for acquiring jobs in the jobImpl that need to be executed and to give them to the jobExecutor thread pool. There is only one dispatcher thread per JobExecutor.

Author:
Tom Baeyens, Guillaume Porcher

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AbstractDispatcherThread()
           
AbstractDispatcherThread(Runnable target)
           
AbstractDispatcherThread(Runnable target, String name)
           
AbstractDispatcherThread(String name)
           
AbstractDispatcherThread(ThreadGroup group, Runnable target)
           
AbstractDispatcherThread(ThreadGroup group, Runnable target, String name)
           
AbstractDispatcherThread(ThreadGroup group, Runnable target, String name, long stackSize)
           
AbstractDispatcherThread(ThreadGroup group, String name)
           
 
Method Summary
protected  Collection<Collection<JobImpl<?>>> acquireJobs()
           
 void deactivate()
           
 void deactivate(boolean join)
           
abstract  AbstractJobExecutor getJobExecutor()
           
protected  Date getNextDueDate()
           
protected  long getWaitPeriod()
           
 boolean isActive()
           
 void jobWasAdded()
           
protected abstract  void putAcquiredJobDbidsOnQueue(Collection<JobImpl<?>> acquiredJobDbids)
           
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractDispatcherThread

public AbstractDispatcherThread()

AbstractDispatcherThread

public AbstractDispatcherThread(Runnable target)
Parameters:
target -

AbstractDispatcherThread

public AbstractDispatcherThread(String name)
Parameters:
name -

AbstractDispatcherThread

public AbstractDispatcherThread(ThreadGroup group,
                                Runnable target)
Parameters:
group -
target -

AbstractDispatcherThread

public AbstractDispatcherThread(ThreadGroup group,
                                String name)
Parameters:
group -
name -

AbstractDispatcherThread

public AbstractDispatcherThread(Runnable target,
                                String name)
Parameters:
target -
name -

AbstractDispatcherThread

public AbstractDispatcherThread(ThreadGroup group,
                                Runnable target,
                                String name)
Parameters:
group -
target -
name -

AbstractDispatcherThread

public AbstractDispatcherThread(ThreadGroup group,
                                Runnable target,
                                String name,
                                long stackSize)
Parameters:
group -
target -
name -
stackSize -
Method Detail

putAcquiredJobDbidsOnQueue

protected abstract void putAcquiredJobDbidsOnQueue(Collection<JobImpl<?>> acquiredJobDbids)

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

acquireJobs

protected Collection<Collection<JobImpl<?>>> acquireJobs()

getNextDueDate

protected Date getNextDueDate()

getWaitPeriod

protected long getWaitPeriod()

deactivate

public void deactivate()

deactivate

public void deactivate(boolean join)

jobWasAdded

public void jobWasAdded()

isActive

public boolean isActive()

getJobExecutor

public abstract AbstractJobExecutor getJobExecutor()


Copyright © 2011 OW2 Consortium. All Rights Reserved.