| |
|
| java.lang.Object java.lang.Thread com.jcorporate.expresso.core.registry.ExpressoThread com.jcorporate.expresso.core.utility.JobHandler
JobHandler | public class JobHandler extends ExpressoThread (Code) | | 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
author: Michael Nash |
log | final protected static Logger log(Code) | | The log4j Logger
|
m_cronMgr | protected Crontab m_cronMgr(Code) | | The crontab for this job handler
|
m_jobHandlerStatus | protected String m_jobHandlerStatus(Code) | | Current handler status
|
m_serverID | protected long m_serverID(Code) | | The server id
|
running | protected boolean running(Code) | | Status flag for if the server is running
|
serverList | protected static Vector serverList(Code) | | The list of JobHandler servers
|
getCronManager | public Crontab getCronManager()(Code) | | Retrieve the crontab for this job handler. Excessive use of this function
may not be threadsafe. Use only for necessary management of the cron
handler and sychronize all modification acccess against the instance.
Crontab instance. |
getID | public long getID()(Code) | | Retrieve the server id
The Job Handler Server ID Number |
getServerList | public Vector getServerList() throws ServerException(Code) | | Return a list of current Job objects
Vector A list of the currently executing jobs throws: ServerException - If the list cannot be obtained |
getStatus | public String getStatus()(Code) | | Useful for determining current state from the outside. Not thread
safe! Use it for debug purposes only, don't actually base decisions
to start or stop the job handler based upon this.
the current status code of the JobHandler. |
main | public static void main(String[] args)(Code) | | Main method so that JobHandler can be launched from a command line
Parameters: args - Command line arguments to supply the information to connectto the database |
registerJobHandler | public synchronized void registerJobHandler()(Code) | | Register JobHandler in the DataBase.
|
resetCurrentJobs | protected synchronized void resetCurrentJobs() throws DBException(Code) | | Marks all current running jobs as "Available"
throws: DBException - upon data access error |
resetQ | public static void resetQ(String dbName) throws DBException(Code) | | Resets any 'running' jobs on startup to available.
Parameters: dbName - The data context to reset. throws: DBException - upon error updating the appropriate fields |
run | public void run()(Code) | | Main thread process of the JobHandler process
|
setDataContext | public void setDataContext(String newDBName)(Code) | | Sets the Job Handler's data context
Parameters: newDBName - The new data context name |
setID | public void setID(long num)(Code) | | Sets the Job Handler Id
Parameters: num - long integer. |
shutDown | public void shutDown()(Code) | | mark thread for shutdown and interrupt
|
|
|
|