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  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<java.lang.String,java.lang.Long> monitoredJobIds
           
protected  java.lang.String name
           
protected  int nbrOfThreads
           
protected  java.util.Map<java.lang.String,java.lang.Thread> threads
           
 
Constructor Summary
JobExecutor()
           
 
Method Summary
 void addMonitoredJobId(java.lang.String threadName, long jobId)
           
protected  java.lang.Thread createThread(java.lang.String threadName)
           
 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<java.lang.Long> getMonitoredJobIds()
           
 java.lang.String getName()
           
 int getNbrOfThreads()
           
protected  java.lang.String getNextThreadName()
           
 int getSize()
          Deprecated. Replaced by {getNbrOfThreads()
 java.util.Map<java.lang.String,java.lang.Thread> 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<java.lang.String,java.lang.Long> 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<java.lang.String,java.lang.Thread> threads)
          Deprecated. threads is an internal control field
 void start()
           
protected  void startThread()
           
 java.util.List<java.lang.Thread> 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

@Deprecated
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<java.lang.String,java.lang.Thread> threads

lockMonitorThread

protected LockMonitorThread lockMonitorThread

monitoredJobIds

protected java.util.Map<java.lang.String,java.lang.Long> monitoredJobIds

isStarted

protected boolean isStarted
Constructor Detail

JobExecutor

public JobExecutor()
Method Detail

start

public void start()

stop

public java.util.List<java.lang.Thread> 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

startThread

protected void startThread()

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<java.lang.Long> getMonitoredJobIds()

addMonitoredJobId

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

removeMonitoredJobId

public void removeMonitoredJobId(java.lang.String threadName)

setMonitoredJobIds

@Deprecated
public void setMonitoredJobIds(java.util.Map<java.lang.String,java.lang.Long> monitoredJobIds)
Deprecated. monitoredJobIds is an internal control field

Throws:
java.lang.UnsupportedOperationException - to prevent invocation

getHistoryMaxSize

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


setHistoryMaxSize

@Deprecated
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

@Deprecated
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

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


setSize

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


getThreads

public java.util.Map<java.lang.String,java.lang.Thread> getThreads()

setThreads

@Deprecated
public void setThreads(java.util.Map<java.lang.String,java.lang.Thread> 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.