org.ofbiz.service.job
Class JobInvoker

java.lang.Object
  extended by org.ofbiz.service.job.JobInvoker
All Implemented Interfaces:
java.lang.Runnable

public class JobInvoker
extends java.lang.Object
implements java.lang.Runnable

JobInvoker


Field Summary
static java.lang.String module
           
static long THREAD_TTL
           
static int WAIT_TIME
           
 
Constructor Summary
protected JobInvoker()
           
  JobInvoker(JobPoller jp)
           
  JobInvoker(JobPoller jp, int wait)
           
 
Method Summary
 long getCurrentRuntime()
          Gets the total time the current job has been running or 0 when sleeping.
 int getCurrentStatus()
          Gets the status code for this thread (0 = sleeping, 1 = running job)
 java.lang.String getJobId()
          Get the current running job's ID.
 java.lang.String getJobName()
          Get the current running job's name.
 java.lang.String getName()
          Gets the name of this JobInvoker.
 java.lang.String getServiceName()
          Returns the name of the service being run.
 java.lang.Long getThreadId()
           
 long getTime()
          Gets the time when this thread was created.
 long getTimeRemaining()
          Gets the remaining time this thread has before it is killed
 int getUsage()
          Gets the number of times this thread was used.
 void kill()
          Kill this invoker thread.s
 void run()
           
 void stop()
          Tells the thread to stop after the next job.
 void wakeUp()
          Wakes up this thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

THREAD_TTL

public static final long THREAD_TTL
See Also:
Constant Field Values

WAIT_TIME

public static final int WAIT_TIME
See Also:
Constant Field Values
Constructor Detail

JobInvoker

public JobInvoker(JobPoller jp)

JobInvoker

public JobInvoker(JobPoller jp,
                  int wait)

JobInvoker

protected JobInvoker()
Method Detail

stop

public void stop()
Tells the thread to stop after the next job.


wakeUp

public void wakeUp()
Wakes up this thread.


getUsage

public int getUsage()
Gets the number of times this thread was used.

Returns:
The number of times used.

getTimeRemaining

public long getTimeRemaining()
Gets the remaining time this thread has before it is killed

Returns:
Time in millis remaining

getTime

public long getTime()
Gets the time when this thread was created.

Returns:
Time in milliseconds when this was created.

getName

public java.lang.String getName()
Gets the name of this JobInvoker.

Returns:
Name of the invoker.

getCurrentStatus

public int getCurrentStatus()
Gets the status code for this thread (0 = sleeping, 1 = running job)

Returns:
0 for sleeping or 1 when running a job.

getCurrentRuntime

public long getCurrentRuntime()
Gets the total time the current job has been running or 0 when sleeping.

Returns:
Total time the curent job has been running.

getThreadId

public java.lang.Long getThreadId()

getJobId

public java.lang.String getJobId()
Get the current running job's ID.

Returns:
String ID of the current running job.

getJobName

public java.lang.String getJobName()
Get the current running job's name.

Returns:
String name of the current running job.

getServiceName

public java.lang.String getServiceName()
Returns the name of the service being run.

Returns:
The name of the service being run.

kill

public void kill()
Kill this invoker thread.s


run

public void run()
Specified by:
run in interface java.lang.Runnable