org.jbpm.job.executor
Class JobExecutor

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

public class JobExecutor
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  int historyMaxSize
          Deprecated. property has no effect
protected static String hostName
          Deprecated. this field was just an aid for generating thread names
protected  int idleInterval
           
protected  boolean isStarted
           
protected  JbpmConfiguration jbpmConfiguration
           
protected  int lockBufferTime
          Deprecated. property has no effect
protected  int lockMonitorInterval
           
protected  LockMonitorThread lockMonitorThread
          Deprecated. call getThreads() instead
protected  int maxIdleInterval
           
protected  int maxLockTime
           
protected  Map monitoredJobIds
           
protected  String name
           
protected  int nbrOfThreads
           
protected  Map threads
          Deprecated. call getThreads() instead
 
Constructor Summary
JobExecutor()
           
 
Method Summary
 void addMonitoredJobId(String threadName, long jobId)
           
protected  Thread createThread(String threadName)
           
 void ensureThreadsAreActive()
           
 int getHistoryMaxSize()
          Deprecated. property has no effect
 int getIdleInterval()
           
 JbpmConfiguration getJbpmConfiguration()
           
protected  String getLastThreadName()
          Deprecated. no longer invoked
 int getLockBufferTime()
          Deprecated. property has no effect
 int getLockMonitorInterval()
           
 int getMaxIdleInterval()
           
 int getMaxLockTime()
           
 Set getMonitoredJobIds()
           
 String getName()
           
 int getNbrOfThreads()
           
protected  String getNextThreadName()
          Deprecated. no longer invoked
 int getRetryInterval()
           
 int getSize()
          Deprecated. replaced by getNbrOfThreads()
 Map getThreads()
           
 boolean isStarted()
          Tells whether this job executor has been started.
 void removeMonitoredJobId(String threadName)
           
 void setHistoryMaxSize(int historyMaxSize)
          Deprecated. property has no effect
 void setIdleInterval(int idleInterval)
           
 void setJbpmConfiguration(JbpmConfiguration jbpmConfiguration)
           
 void setLockBufferTime(int lockBufferTime)
          Deprecated. property has no effect
 void setLockMonitorInterval(int lockMonitorInterval)
           
 void setMaxIdleInterval(int maxIdleInterval)
           
 void setMaxLockTime(int maxLockTime)
           
 void setMonitoredJobIds(Map monitoredJobIds)
          Deprecated. call addMonitoredJobId(String, long) or removeMonitoredJobId(String) to manipulate the set of monitored jobs
 void setName(String name)
           
 void setNbrOfThreads(int nbrOfThreads)
           
 void setRetryInterval(int retryInterval)
           
 void setSize(int nbrOfThreads)
          Deprecated. replaced by setNbrOfThreads(int)
 void setStarted(boolean isStarted)
          Deprecated. call start() or stop() to control this job executor.
 void setThreads(Map threads)
          Deprecated. this job executor manages its own thread pool
 void start()
           
protected  void startThread()
          Deprecated. no longer invoked
protected  void startThread(String threadName)
           
 List stop()
          tells all threads in this job executor to stop.
 void stopAndJoin()
           
protected  Thread stopThread()
          Deprecated. no longer invoked
 
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 String name

nbrOfThreads

protected int nbrOfThreads

idleInterval

protected int idleInterval

maxIdleInterval

protected int maxIdleInterval

historyMaxSize

protected int historyMaxSize
Deprecated. property has no effect

maxLockTime

protected int maxLockTime

lockMonitorInterval

protected int lockMonitorInterval

lockBufferTime

protected int lockBufferTime
Deprecated. property has no effect

threads

protected Map threads
Deprecated. call getThreads() instead

lockMonitorThread

protected LockMonitorThread lockMonitorThread
Deprecated. call getThreads() instead

monitoredJobIds

protected Map monitoredJobIds

isStarted

protected boolean isStarted

hostName

protected static String hostName
Deprecated. this field was just an aid for generating thread names
Constructor Detail

JobExecutor

public JobExecutor()
Method Detail

start

public void start()

stop

public List stop()
tells 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 InterruptedException
Throws:
InterruptedException

ensureThreadsAreActive

public void ensureThreadsAreActive()

startThread

protected void startThread()
Deprecated. no longer invoked


startThread

protected void startThread(String threadName)

createThread

protected Thread createThread(String threadName)

getNextThreadName

protected String getNextThreadName()
Deprecated. no longer invoked


getLastThreadName

protected String getLastThreadName()
Deprecated. no longer invoked


stopThread

protected Thread stopThread()
Deprecated. no longer invoked


getMonitoredJobIds

public Set getMonitoredJobIds()

addMonitoredJobId

public void addMonitoredJobId(String threadName,
                              long jobId)

removeMonitoredJobId

public void removeMonitoredJobId(String threadName)

setMonitoredJobIds

public void setMonitoredJobIds(Map monitoredJobIds)
Deprecated. call addMonitoredJobId(String, long) or removeMonitoredJobId(String) to manipulate the set of monitored jobs

Method has no effect.


getHistoryMaxSize

public int getHistoryMaxSize()
Deprecated. property has no effect


setHistoryMaxSize

public void setHistoryMaxSize(int historyMaxSize)
Deprecated. property has no effect


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. call start() or stop() to control this job executor.

This method has no effect.


getJbpmConfiguration

public JbpmConfiguration getJbpmConfiguration()

setJbpmConfiguration

public void setJbpmConfiguration(JbpmConfiguration jbpmConfiguration)

getRetryInterval

public int getRetryInterval()

setRetryInterval

public void setRetryInterval(int retryInterval)

getMaxIdleInterval

public int getMaxIdleInterval()

setMaxIdleInterval

public void setMaxIdleInterval(int maxIdleInterval)

getName

public String getName()

setName

public void setName(String name)

getSize

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


setSize

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


getThreads

public Map getThreads()

setThreads

public void setThreads(Map threads)
Deprecated. this job executor manages its own thread pool

This method has no effect.


getMaxLockTime

public int getMaxLockTime()

setMaxLockTime

public void setMaxLockTime(int maxLockTime)

getLockBufferTime

public int getLockBufferTime()
Deprecated. property has no effect


setLockBufferTime

public void setLockBufferTime(int lockBufferTime)
Deprecated. property has no effect


getLockMonitorInterval

public int getLockMonitorInterval()

setLockMonitorInterval

public void setLockMonitorInterval(int lockMonitorInterval)

getNbrOfThreads

public int getNbrOfThreads()

setNbrOfThreads

public void setNbrOfThreads(int nbrOfThreads)


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