|
Expresso 5-5-0 | ||||||||||
| 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.job.Job
A Job is an asynchronous task who's results will generally be emailed to the user initiating the job. Jobs themselves are executed by JobHandler, and are also capable of getting queued in such a way as to repeatedly execute.
JobHandler| Field Summary | |
static String |
IS_NOTIFY_ON_JOB_SUCCESS
|
protected static org.apache.log4j.Logger |
log
The log4j Logger |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
Job()
Default Constructor |
|
| Method Summary | |
protected void |
addFunction(String name,
String descrip)
If a job can do more than one distinct function, it registers those functions so that the administration controller can tell the user about them. |
protected void |
addParameter(String paramCode,
String paramDescrip)
Add a parameter |
void |
addParamValidValues(String paramCode,
Vector paramValidValues)
Adds a list of valid values for the particular parmeters. |
protected void |
finish(String msg)
Finish up the Job, clearing the job queue entry, sending a completion email, flush the queues, etc |
protected void |
finish(String msg,
Throwable t)
Finish up the Job, clearing the job queue entry, sending a completion email, flush the queues, etc |
CrontabEntry |
getCronAlarmEntry()
Retrieve the cron alarm entry |
protected String |
getDataContext()
Retrieve the data context of the job |
protected String |
getDBName()
Deprecated. since Expresso 5.3 use getDataContext() instead |
Hashtable |
getFunctions()
Retrieve the functions the Job Handler can execute |
String |
getJobNumber()
Return the jobnumber of this job |
protected String |
getJobParameter(String paramCode)
Convenience method to get the job parameters one by one as needed. |
protected List |
getJobParameterList()
Returns a List of the parameters given to the job |
protected Vector |
getJobParameters()
Deprecated. Use either getJobParametersList or getJobParameter |
JobQueue |
getJobQueueEntry()
Return the job queue entry that caused this job to begin |
String |
getParameter(String paramName)
Deprecated. use getParameterDescription |
String |
getParameterDescription(String paramName)
Get the value of a specified parameter |
Hashtable |
getParameterNamesAndDescriptions()
Retreive all parameters |
Hashtable |
getParameters()
Deprecated. use getParameterNamesAndDescriptions |
Vector |
getParamValidValues(String paramCode)
Retrieve all valid values for the given parameter |
protected String |
getSchema(String schemaClass)
Instantiate & return the schema class given in the current parameter BUG BUG: This function isn't right, what was the intention: -MR |
protected String |
getString(String stringCode)
Getstring without any substitution capabilities |
protected String |
getString(String stringCode,
Object[] args)
Pass on a call to retrieve an appropriate localized string from the correct Schema object. |
protected String |
getString(String stringCode,
String arg1)
Internationalization methods. |
protected String |
getString(String stringCode,
String arg1,
String arg2)
Internationalization methods. |
protected String |
getString(String stringCode,
String arg1,
String arg2,
String arg3)
Internationalization methods. |
protected String |
getString(String stringCode,
String arg1,
String arg2,
String arg3,
String arg4)
Internationalization methods. |
String |
getTitle()
Retrieve the title of the job. |
String |
getUser()
Return the username who requested this job |
protected boolean |
hasParameters()
Does this job have parameters? |
static Job |
instantiate(String className)
Convenience method to create a Job from it's name |
boolean |
multiThreaded()
Implementors of this class must override this to return true if they are multi-threaded, e.g. can be run at the same time as other jobs. |
void |
run()
Implement the actual logic for this server object |
protected void |
sendMail(String subject,
String myRecipients,
Vector mailMessage)
Send an e-mail message to a list of recipients |
void |
setCronAlarmEntry(CrontabEntry obj)
Sets the cron alarm entry |
void |
setQueue(JobQueue newJobQueue)
Set the JobQueue object that created this job. |
protected void |
setSchema(String schemaClass)
Tell this Job object what Schema it belongs to. |
void |
setUseCron(boolean useCron)
If a job will be executed in cron process - say it |
boolean |
useCron()
Should we use Crontab? |
| 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 org.apache.log4j.Logger log
public static final String IS_NOTIFY_ON_JOB_SUCCESS
| Constructor Detail |
public Job()
| Method Detail |
protected void addFunction(String name,
String descrip)
name - the name of the functiondescrip - the function descriptionpublic void setUseCron(boolean useCron)
useCron - true if this job will be executed in cron processpublic void setCronAlarmEntry(CrontabEntry obj)
obj - the cron alarm entrypublic CrontabEntry getCronAlarmEntry()
public boolean useCron()
protected void addParameter(String paramCode,
String paramDescrip)
paramCode - the actual parameter code, similar to the parameter
code for a controller.paramDescrip - The "user friendly" name of the description.
public void addParamValidValues(String paramCode,
Vector paramValidValues)
paramCode - the parameter codeparamValidValues - Vector of valid value objectsprotected void finish(String msg)
msg - the message to send to the queuing user
protected void finish(String msg,
Throwable t)
msg - the message to send to the queuing usert - The Exception to log in the messagepublic Hashtable getFunctions()
public String getJobNumber()
public JobQueue getJobQueueEntry()
throws DBException
DBException - If the object cannot be returnedpublic Hashtable getParameters()
public String getParameter(String paramName)
paramName - the parameter name
public Hashtable getParameterNamesAndDescriptions()
public String getParameterDescription(String paramName)
paramName - the parameter name
public Vector getParamValidValues(String paramCode)
paramCode - the parameter name
public String getTitle()
public String getUser()
public boolean multiThreaded()
public void run()
protected void sendMail(String subject,
String myRecipients,
Vector mailMessage)
subject - Subject of the messagemyRecipients - Recipients of the messagemailMessage - Contents of the message, as strings in a vectorpublic void setQueue(JobQueue newJobQueue)
newJobQueue - JobQueue object that triggered this job
protected String getDBName()
throws DBException
DBException
protected String getDataContext()
throws DBException
DBExceptionprotected void setSchema(String schemaClass)
schemaClass - the schema class nameprotected String getString(String stringCode)
stringCode -
Messages.getString(java.lang.String, java.util.Locale, java.lang.String, java.lang.Object[])
protected String getString(String stringCode,
String arg1)
stringCode - the string code to look up in the messages bundlearg1 - Formatting argument
IllegalArgumentException - if the stringCode cannot be found in
the schema's message bundle.Messages.getString(java.lang.String, java.util.Locale, java.lang.String, java.lang.Object[])
protected String getString(String stringCode,
String arg1,
String arg2)
stringCode - the string code to look up in the messages bundlearg1 - Formatting argumentarg2 - Formatting argument
IllegalArgumentException - if the stringCode cannot be found in
the schema's message bundle.Messages.getString(java.lang.String, java.util.Locale, java.lang.String, java.lang.Object[])
protected String getString(String stringCode,
String arg1,
String arg2,
String arg3)
stringCode - the string code to look up in the messages bundlearg1 - Formatting argumentarg2 - Formatting argumentarg3 - Formatting argument
IllegalArgumentException - if the stringCode cannot be found in
the schema's message bundle.Messages.getString(java.lang.String, java.util.Locale, java.lang.String, java.lang.Object[])
protected String getString(String stringCode,
String arg1,
String arg2,
String arg3,
String arg4)
stringCode - the string code to look up in the messages bundlearg1 - Formatting argumentarg2 - Formatting argumentarg3 - Formatting argumentarg4 - Formatting argument
IllegalArgumentException - if the stringCode cannot be found in
the schema's message bundle.Messages.getString(java.lang.String, java.util.Locale, java.lang.String, java.lang.Object[])
protected String getString(String stringCode,
Object[] args)
stringCode - the string code to look up in the messages bundleargs - the formatting object array
IllegalArgumentException - if the stringCode cannot be found in
the schema's message bundle.
protected boolean hasParameters()
throws DBException
DBException - upon error
protected Vector getJobParameters()
throws DBException
DBException - upon error
protected List getJobParameterList()
throws DBException
DBException - upon error
protected String getJobParameter(String paramCode)
throws DBException
paramCode - to retrieve.
DBException - if there's an error reading the values.
protected String getSchema(String schemaClass)
throws ServerException
schemaClass - the schema class to set
ServerException
public static Job instantiate(String className)
throws ServerException
className - the classname to instantiate
ServerException - upon instantiation error
|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||