oemware.core
Class SharedJobRunner

java.lang.Object
  extended by java.lang.Thread
      extended by oemware.core.ThreadBase
          extended by oemware.core.SingleThread
              extended by oemware.core.SharedJobRunner
All Implemented Interfaces:
java.lang.Runnable

public final class SharedJobRunner
extends SingleThread

The shared job runner is a single thread that is used amongst a group of low priority jobs. The jobs registered should take less than a second to execute; additionally, the jobs should be relatively infrequent (i.e., five seconds or greater). The execution of the job is also not exact since they're executed synchronously. The thread executes a check once per mSleepTime (ms) to see if it should run any jobs.

All jobs are run on startup. Set the mMaxTimeBeforeError attribute to log an error for long running jobs.

The purpose of this component is to reduce the number of monitor threads running in the instance (consuming resources).

You can create multiple job runner components in an instance.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class oemware.core.ThreadBase
mJoinThread, mJoinTimeout, mRunning
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SharedJobRunner()
           
 
Method Summary
 void execute()
          Implement this method.
 java.util.List<SharedJob> getJobs()
           
 long getMaxTimeBeforeError()
           
 void setJobs(java.util.List<SharedJob> pJobs)
           
 void setMaxTimeBeforeError(long pMaxTimeBeforeError)
           
 
Methods inherited from class oemware.core.SingleThread
getDeductExecuteTime, getSleepTime, run, setDeductExecuteTime, setSleepTime
 
Methods inherited from class oemware.core.ThreadBase
afterStart, afterStop, beforeStart, beforeStop, getJoinThread, getJoinTimeout, isRunning, setJoinThread, setJoinTimeout, shutdown, startup
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SharedJobRunner

public SharedJobRunner()
Method Detail

execute

public final void execute()
Description copied from class: SingleThread
Implement this method.

Specified by:
execute in class SingleThread

setJobs

public final void setJobs(java.util.List<SharedJob> pJobs)

getJobs

public final java.util.List<SharedJob> getJobs()

setMaxTimeBeforeError

public final void setMaxTimeBeforeError(long pMaxTimeBeforeError)

getMaxTimeBeforeError

public final long getMaxTimeBeforeError()


Copyright © 2009 Deft Labs - Released under LGPL, Version 3.0