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

java.lang.Object
  extended by org.ow2.orchestra.pvm.internal.jobexecutor.AbstractJobExecutor
      extended by org.ow2.orchestra.pvm.internal.jobexecutor.pvm.PvmJobExecutor
All Implemented Interfaces:
JobExecutor

public class PvmJobExecutor
extends AbstractJobExecutor
implements JobExecutor

manager for jobImpl execution threads and their configuration.

Author:
Tom Baeyens, Guillaume Porcher

Field Summary
 
Fields inherited from class org.ow2.orchestra.pvm.internal.jobexecutor.AbstractJobExecutor
acquireJobsCommand, commandService, deadJobHandler, idleMillis, isActive, limitSameInstanceJobs, lockMillis, LOG, name, nextDueDateCommand
 
Constructor Summary
PvmJobExecutor()
           
 
Method Summary
protected  int getAcquireJobSize()
           
 DispatcherThread getDispatcherThread()
           
 List<JobHistoryEntry> getHistory()
           
 int getHistorySize()
           
protected  BlockingQueue<Runnable> getJobTasksQueue()
           
 int getNbrOfThreads()
           
 ThreadPoolExecutor getThreadPool()
           
 void setHistoryMaxSize(int historyMaxSize)
           
 void setNbrOfJobExecutorThreads(int nbrOfJobExecutorThreads)
           
 void start()
          starts the DispatcherThread and org.ow2.orchestra.pvm.internal.jobexecutor.pvm.JobExecutorThreads for this jobImpl executor
 void stop()
          stops with join set to false.
 void stop(boolean join)
          signals to all threads managed by this jobImpl executor to stop.
protected  void waitTillQueueEmpty()
           
 
Methods inherited from class org.ow2.orchestra.pvm.internal.jobexecutor.AbstractJobExecutor
getAcquireJobsCommand, getCommandExecutor, getDeadJobHandler, getHostName, getIdleMillis, getLockMillis, getName, getNextDueDateCommand, isActive, isLimitSameInstanceJobs, jobWasAdded, setCommandExecutor, setDeadJobHandler, setIdleInterval, setLimitSameInstanceJobs, setMaxLockTime, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.orchestra.pvm.internal.jobexecutor.JobExecutor
getDeadJobHandler, getName, isActive, jobWasAdded
 

Constructor Detail

PvmJobExecutor

public PvmJobExecutor()
Method Detail

start

public void start()
Description copied from interface: JobExecutor
starts the DispatcherThread and org.ow2.orchestra.pvm.internal.jobexecutor.pvm.JobExecutorThreads for this jobImpl executor

Specified by:
start in interface JobExecutor
Specified by:
start in class AbstractJobExecutor

stop

public void stop()
Description copied from interface: JobExecutor
stops with join set to false.

Specified by:
stop in interface JobExecutor
Specified by:
stop in class AbstractJobExecutor
See Also:
JobExecutor.stop(boolean)

stop

public void stop(boolean join)
Description copied from interface: JobExecutor
signals to all threads managed by this jobImpl 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 jobImpl executor threads are joined and actually dead. If join is false, the jobImpl executor threads are only told to stop, without waiting till they are actually stopped. It may be that jobImpl executor threads are in the middle of executing a jobImpl and they may finish after this method returned.

Specified by:
stop in interface JobExecutor
Specified by:
stop in class AbstractJobExecutor

waitTillQueueEmpty

protected void waitTillQueueEmpty()

getJobTasksQueue

protected BlockingQueue<Runnable> getJobTasksQueue()

getAcquireJobSize

protected int getAcquireJobSize()
Specified by:
getAcquireJobSize in class AbstractJobExecutor

getHistorySize

public int getHistorySize()

getNbrOfThreads

public int getNbrOfThreads()

getDispatcherThread

public DispatcherThread getDispatcherThread()
Specified by:
getDispatcherThread in class AbstractJobExecutor

getThreadPool

public ThreadPoolExecutor getThreadPool()
Returns:
the threadPool

getHistory

public List<JobHistoryEntry> getHistory()

setNbrOfJobExecutorThreads

public void setNbrOfJobExecutorThreads(int nbrOfJobExecutorThreads)

setHistoryMaxSize

public void setHistoryMaxSize(int historyMaxSize)


Copyright © 2011 OW2 Consortium. All Rights Reserved.