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. property has no effect
protected static java.lang.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  java.util.Map monitoredJobIds
           
protected  java.lang.String name
           
protected  int nbrOfThreads
           
protected  java.util.Map threads
          Deprecated. call getThreads() instead
 
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. property has no effect
 int getIdleInterval()
           
 JbpmConfiguration getJbpmConfiguration()
           
protected  java.lang.String getLastThreadName()
           
 int getLockBufferTime()
          Deprecated. property has no effect
 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. 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(java.util.Map monitoredJobIds)
          Deprecated. call addMonitoredJobId(String, long) or removeMonitoredJobId(String) to manipulate the set of monitored jobs
 void setName(java.lang.String name)
           
 void setNbrOfThreads(int nbrOfThreads)
           
 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(java.util.Map threads)
          Deprecated. this job executor manages its own thread pool
 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()
          Deprecated.  
 
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. property has no effect

maxLockTime

protected int maxLockTime

lockMonitorInterval

protected int lockMonitorInterval

lockBufferTime

protected int lockBufferTime
Deprecated. property has no effect

threads

protected java.util.Map threads
Deprecated. call getThreads() instead

lockMonitorThread

protected LockMonitorThread lockMonitorThread
Deprecated. call getThreads() instead

monitoredJobIds

protected java.util.Map monitoredJobIds

isStarted

protected boolean isStarted

hostName

protected static java.lang.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 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()
Deprecated. 


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. 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)

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. 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 © 2010 JBoss Community. All Rights Reserved.