|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
com.jcorporate.expresso.core.registry.ExpressoThread
com.jcorporate.expresso.core.utility.JobHandler
The JobHandler is an object which runs constantly on the server side, looking periodically in a job queue for work to do. If it finds work to do, it spawns a new server object as specified in the queue. It may either wait for that object to complete or spawn it as a seperate thread, depending on setup options for the object being spawned
| Field Summary | |
protected static org.apache.log4j.Logger |
log
The log4j Logger |
protected Crontab |
m_cronMgr
The crontab for this job handler |
protected String |
m_jobHandlerStatus
Current handler status |
protected long |
m_serverID
The server id |
protected boolean |
running
Status flag for if the server is running |
protected static Vector |
serverList
The list of JobHandler servers |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
JobHandler(String dbName)
Constructor |
|
| Method Summary | |
Crontab |
getCronManager()
Retrieve the crontab for this job handler. |
long |
getID()
Retrieve the server id |
Vector |
getServerList()
Return a list of current Job objects |
String |
getStatus()
Useful for determining current state from the outside. |
static void |
main(String[] args)
Main method so that JobHandler can be launched from a command line |
void |
registerJobHandler()
Register JobHandler in the DataBase. |
protected void |
resetCurrentJobs()
Marks all current running jobs as "Available" |
static void |
resetQ(String dbName)
Resets any 'running' jobs on startup to available. |
void |
run()
Main thread process of the JobHandler process |
void |
setDataContext(String newDBName)
Sets the Job Handler's data context |
void |
setID(long num)
Sets the Job Handler Id |
void |
shutDown()
mark thread for shutdown and interrupt |
| Methods inherited from class com.jcorporate.expresso.core.registry.ExpressoThread |
getThreadContext |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 |
| Field Detail |
protected static Vector serverList
protected static final org.apache.log4j.Logger log
protected Crontab m_cronMgr
protected String m_jobHandlerStatus
protected boolean running
protected long m_serverID
| Constructor Detail |
public JobHandler(String dbName)
throws DBException,
ServerException
dbName - The data context for this job handler to run in.
DBException - If the database cannot be contacted
ServerException - If another uncaught exception occurs| Method Detail |
public void setDataContext(String newDBName)
newDBName - The new data context namepublic void setID(long num)
num - long integer.public long getID()
public Crontab getCronManager()
public Vector getServerList()
throws ServerException
ServerException - If the list cannot be obtainedpublic static void main(String[] args)
args - Command line arguments to supply the information to connect
to the database
public static void resetQ(String dbName)
throws DBException
dbName - The data context to reset.
DBException - upon error updating the appropriate fieldspublic String getStatus()
public void registerJobHandler()
public void run()
public void shutDown()
protected void resetCurrentJobs()
throws DBException
DBException - upon data access error
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||