org.jbpm.jobexecutor
Class JobExecutor

java.lang.Object
  extended by org.jbpm.jobexecutor.JobExecutor
All Implemented Interfaces:
java.io.Serializable

public class JobExecutor
extends java.lang.Object
implements java.io.Serializable

manager for job execution threads and their configuration.

Author:
Tom Baeyens, Guillaume Porcher
See Also:
Serialized Form

Constructor Summary
JobExecutor()
           
 
Method Summary
 Command<java.util.Collection<java.lang.Long>> getAcquireJobsCommand()
           
 CommandService getCommandExecutor()
           
 DispatcherThread getDispatcherThread()
           
 java.util.List<JobHistoryEntry> getHistory()
           
 int getHistorySize()
           
protected static java.lang.String getHostName()
           
 int getIdleMillis()
           
 int getIdleMillisMax()
           
protected  java.util.concurrent.BlockingQueue<java.util.Collection<java.lang.Long>> getJobDbidsQueue()
           
 int getLockMillis()
           
 int getLockMillisBuffer()
           
 java.lang.String getName()
           
 int getNbrOfThreads()
           
 Command<java.util.Date> getNextDueDateCommand()
           
 boolean isActive()
           
 void jobWasAdded()
           
 void setCommandExecutor(CommandService commandService)
           
 void setHistoryMaxSize(int historyMaxSize)
           
 void setIdleInterval(int idleInterval)
           
 void setLockBufferPeriod(int lockBufferPeriod)
           
 void setMaxIdleInterval(int maxIdleInterval)
           
 void setMaxLockTime(int maxLockTime)
           
 void setName(java.lang.String name)
           
 void setNbrOfJobExecutorThreads(int nbrOfJobExecutorThreads)
           
 void start()
          starts the DispatcherThread and JobExecutorThreads for this job executor
 void stop()
          stops with join set to false.
 void stop(boolean join)
          signals to all threads managed by this job executor to stop.
protected  void waitTillQueueEmpty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobExecutor

public JobExecutor()
Method Detail

start

public void start()
starts the DispatcherThread and JobExecutorThreads for this job executor


stop

public void stop()
stops with join set to false.

See Also:
stop(boolean)

stop

public void stop(boolean join)
signals to all threads managed by this job executor to stop. Stopping the dispatcher thread is blocking till the dispatcher is no more alive. If join is set to true, this method will block until all job executor threads are joined and actually dead. If join is false, the job executor threads are only told to stop, without waiting till they are actually stopped. It may be that job executor threads are in the middle of executing a job and they may finish after this method returned.


waitTillQueueEmpty

protected void waitTillQueueEmpty()

jobWasAdded

public void jobWasAdded()

getHostName

protected static java.lang.String getHostName()

getJobDbidsQueue

protected java.util.concurrent.BlockingQueue<java.util.Collection<java.lang.Long>> getJobDbidsQueue()

getName

public java.lang.String getName()

getHistorySize

public int getHistorySize()

getIdleMillis

public int getIdleMillis()

isActive

public boolean isActive()

getIdleMillisMax

public int getIdleMillisMax()

getLockMillis

public int getLockMillis()

getLockMillisBuffer

public int getLockMillisBuffer()

getNbrOfThreads

public int getNbrOfThreads()

getCommandExecutor

public CommandService getCommandExecutor()

getAcquireJobsCommand

public Command<java.util.Collection<java.lang.Long>> getAcquireJobsCommand()

getNextDueDateCommand

public Command<java.util.Date> getNextDueDateCommand()

getDispatcherThread

public DispatcherThread getDispatcherThread()

getHistory

public java.util.List<JobHistoryEntry> getHistory()

setCommandExecutor

public void setCommandExecutor(CommandService commandService)

setName

public void setName(java.lang.String name)

setNbrOfJobExecutorThreads

public void setNbrOfJobExecutorThreads(int nbrOfJobExecutorThreads)

setIdleInterval

public void setIdleInterval(int idleInterval)

setMaxIdleInterval

public void setMaxIdleInterval(int maxIdleInterval)

setHistoryMaxSize

public void setHistoryMaxSize(int historyMaxSize)

setMaxLockTime

public void setMaxLockTime(int maxLockTime)

setLockBufferPeriod

public void setLockBufferPeriod(int lockBufferPeriod)