org.jbpm.job.executor
Class JobExecutor

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

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

See Also:
Serialized Form

Field Summary
protected  int historyMaxSize
          Deprecated. this field was never used
protected static java.lang.String hostName
           
protected  int idleInterval
           
protected  boolean isStarted
           
protected  JbpmConfiguration jbpmConfiguration
           
protected  int lockBufferTime
           
protected  int lockMonitorInterval
           
protected  LockMonitorThread lockMonitorThread
           
protected  int maxIdleInterval
           
protected  int maxLockTime
           
protected  java.util.Map monitoredJobIds
           
protected  java.lang.String name
           
protected  int nbrOfThreads
           
protected  java.util.Map threads
           
 
Constructor Summary
JobExecutor()
           
 
Method Summary
 void addMonitoredJobId(java.lang.String threadName, long jobId)
           
protected  java.lang.Thread createThread(java.lang.String threadName)
           
 void ensureThreadsAreActive()
           
 int getHistoryMaxSize()
          Deprecated. this property was never used
 int getIdleInterval()
           
 JbpmConfiguration getJbpmConfiguration()
           
protected  java.lang.String getLastThreadName()
           
 int getLockBufferTime()
           
 int getLockMonitorInterval()
           
 int getMaxIdleInterval()
           
 int getMaxLockTime()
           
 java.util.Set getMonitoredJobIds()
           
 java.lang.String getName()
           
 int getNbrOfThreads()
           
protected  java.lang.String getNextThreadName()
           
 int getSize()
          Deprecated. Replaced by getNbrOfThreads()
 java.util.Map getThreads()
           
 boolean isStarted()
          Tells whether this job executor has been started.
 void removeMonitoredJobId(java.lang.String threadName)
           
 void setHistoryMaxSize(int historyMaxSize)
          Deprecated. this property was never used
 void setIdleInterval(int idleInterval)
           
 void setJbpmConfiguration(JbpmConfiguration jbpmConfiguration)
           
 void setLockBufferTime(int lockBufferTime)
           
 void setLockMonitorInterval(int lockMonitorInterval)
           
 void setMaxIdleInterval(int maxIdleInterval)
           
 void setMaxLockTime(int maxLockTime)
           
 void setMonitoredJobIds(java.util.Map monitoredJobIds)
          Deprecated. monitoredJobIds is an internal control field
 void setName(java.lang.String name)
           
 void setNbrOfThreads(int nbrOfThreads)
           
 void setSize(int nbrOfThreads)
          Deprecated. Replaced by setNbrOfThreads(int)
 void setStarted(boolean isStarted)
          Deprecated. isStarted is an internal control field
 void setThreads(java.util.Map threads)
          Deprecated. threads is an internal control field
 void start()
           
protected  void startThread()
           
protected  void startThread(java.lang.String threadName)
           
 java.util.List stop()
          signals to all threads in this job executor to stop.
 void stopAndJoin()
           
protected  java.lang.Thread stopThread()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jbpmConfiguration

protected JbpmConfiguration jbpmConfiguration

name

protected java.lang.String name

nbrOfThreads

protected int nbrOfThreads

idleInterval

protected int idleInterval

maxIdleInterval

protected int maxIdleInterval

historyMaxSize

protected int historyMaxSize
Deprecated. this field was never used

maxLockTime

protected int maxLockTime

lockMonitorInterval

protected int lockMonitorInterval

lockBufferTime

protected int lockBufferTime

threads

protected java.util.Map threads

lockMonitorThread

protected LockMonitorThread lockMonitorThread

monitoredJobIds

protected java.util.Map monitoredJobIds

isStarted

protected boolean isStarted

hostName

protected static java.lang.String hostName
Constructor Detail

JobExecutor

public JobExecutor()
Method Detail

start

public void start()

stop

public java.util.List stop()
signals to all threads in this job executor to stop. Threads may be in the middle of processing a job and they will finish that first. Use stopAndJoin() in case you want a method that blocks until all the threads are actually finished.

Returns:
a list of the stopped threads. In case no threads were stopped an empty list will be returned.

stopAndJoin

public void stopAndJoin()
                 throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

ensureThreadsAreActive

public void ensureThreadsAreActive()

startThread

protected void startThread()

startThread

protected void startThread(java.lang.String threadName)

createThread

protected java.lang.Thread createThread(java.lang.String threadName)

getNextThreadName

protected java.lang.String getNextThreadName()

getLastThreadName

protected java.lang.String getLastThreadName()

stopThread

protected java.lang.Thread stopThread()

getMonitoredJobIds

public java.util.Set getMonitoredJobIds()

addMonitoredJobId

public void addMonitoredJobId(java.lang.String threadName,
                              long jobId)

removeMonitoredJobId

public void removeMonitoredJobId(java.lang.String threadName)

setMonitoredJobIds

public void setMonitoredJobIds(java.util.Map monitoredJobIds)
Deprecated. monitoredJobIds is an internal control field

Throws:
java.lang.UnsupportedOperationException - to prevent invocation

getHistoryMaxSize

public int getHistoryMaxSize()
Deprecated. this property was never used


setHistoryMaxSize

public void setHistoryMaxSize(int historyMaxSize)
Deprecated. this property was never used


getIdleInterval

public int getIdleInterval()

setIdleInterval

public void setIdleInterval(int idleInterval)

isStarted

public boolean isStarted()
Tells whether this job executor has been started.


setStarted

public void setStarted(boolean isStarted)
Deprecated. isStarted is an internal control field

Throws:
java.lang.UnsupportedOperationException - to prevent invocation

getJbpmConfiguration

public JbpmConfiguration getJbpmConfiguration()

setJbpmConfiguration

public void setJbpmConfiguration(JbpmConfiguration jbpmConfiguration)

getMaxIdleInterval

public int getMaxIdleInterval()

setMaxIdleInterval

public void setMaxIdleInterval(int maxIdleInterval)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getSize

public int getSize()
Deprecated. Replaced by getNbrOfThreads()


setSize

public void setSize(int nbrOfThreads)
Deprecated. Replaced by setNbrOfThreads(int)


getThreads

public java.util.Map getThreads()

setThreads

public void setThreads(java.util.Map threads)
Deprecated. threads is an internal control field

Throws:
java.lang.UnsupportedOperationException - to prevent invocation

getMaxLockTime

public int getMaxLockTime()

setMaxLockTime

public void setMaxLockTime(int maxLockTime)

getLockBufferTime

public int getLockBufferTime()

setLockBufferTime

public void setLockBufferTime(int lockBufferTime)

getLockMonitorInterval

public int getLockMonitorInterval()

setLockMonitorInterval

public void setLockMonitorInterval(int lockMonitorInterval)

getNbrOfThreads

public int getNbrOfThreads()

setNbrOfThreads

public void setNbrOfThreads(int nbrOfThreads)


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.