public class JobContext extends Object
Constructor and Description |
---|
JobContext(Job currentJob,
org.quartz.JobExecutionContext quartzContext,
WGACore wgaCore,
org.apache.log4j.Logger log)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
breakIfCancelled()
Throws a
JobFailedException if the Job has been cancelled. |
de.innovationgate.webgate.api.WGDatabase |
db(String dbkey)
Deprecated.
Use
WGA object to access WGA global resources like these |
Job |
getCurrentJob()
Returns the object representing the current job
|
Task |
getCurrentTask()
Returns the object representing the current task
|
Map<String,Object> |
getCustomOptions()
Returns custom options that have been added to this runtime of the job
Use this method especially to retrieve custom options that are not of String value
|
Set<String> |
getDatabaseKeys()
Deprecated.
Use
WGA object to access WGA global resources like these |
org.apache.log4j.Logger |
getLog()
Returns a logger object to log output to the WGA application log
|
String |
getOption(String name)
Returns a task option.
|
String |
getOption(String name,
String defaultValue)
Returns a task option
|
Map<String,String> |
getOptions()
Deprecated.
Use
getOption(String) to read an option no matter where it is defined |
Object |
getPreviousResult()
Returns the result of the previous task in this Job, if any.
|
org.quartz.JobExecutionContext |
getQuartzContext()
Returns the schedulers Quartz context.
|
Object |
getResult()
Returns the result of this task
|
WGACore |
getWgaCore()
Deprecated.
Use
WGA object to access WGA global resources like these |
boolean |
isCancelable() |
boolean |
isCancelled()
Returns if this Job was cancelled
|
void |
setCancelable(boolean cancelable) |
void |
setResult(Object object)
Sets the result of this task
|
public JobContext(Job currentJob, org.quartz.JobExecutionContext quartzContext, WGACore wgaCore, org.apache.log4j.Logger log)
quartzContext
- wgaCore
- log
- public Map<String,String> getOptions()
getOption(String)
to read an option no matter where it is definedpublic String getOption(String name)
name
- Name of the optionpublic String getOption(String name, String defaultValue)
name
- Name of the optiondefaultValue
- Value to return if the option does not existpublic org.quartz.JobExecutionContext getQuartzContext()
public WGACore getWgaCore()
WGA
object to access WGA global resources like thesepublic Object getResult()
public void setResult(Object object)
object
- The tasks resultpublic org.apache.log4j.Logger getLog()
public Map<String,Object> getCustomOptions()
public Object getPreviousResult()
public Job getCurrentJob()
public Task getCurrentTask()
public de.innovationgate.webgate.api.WGDatabase db(String dbkey) throws de.innovationgate.webgate.api.WGAPIException
WGA
object to access WGA global resources like theseWGDatabase
object of the application / data source with the given database keydbkey
- The database keyde.innovationgate.webgate.api.WGAPIException
public Set<String> getDatabaseKeys()
WGA
object to access WGA global resources like thesepublic boolean isCancelled()
public void breakIfCancelled() throws JobCancelledException
JobFailedException
if the Job has been cancelled.
Use this call inside a Jobs code at a place where the Job can be safely cancelled without leaving any data inconsistent.JobFailedException
JobCancelledException
public boolean isCancelable()
public void setCancelable(boolean cancelable)