public class JobContext
extends java.lang.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(java.lang.String dbkey)
Deprecated.
Use
WGA object to access WGA global resources like these |
void |
dbUpdated(de.innovationgate.webgate.api.WGDatabase db) |
Job |
getCurrentJob()
Returns the object representing the current job
|
Task |
getCurrentTask()
Returns the object representing the current task
|
java.util.Map<java.lang.String,java.lang.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
|
java.util.Set<java.lang.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
|
java.lang.String |
getOption(java.lang.String name)
Returns a task option.
|
java.lang.String |
getOption(java.lang.String name,
java.lang.String defaultValue)
Returns a task option
|
java.util.Map<java.lang.String,java.lang.String> |
getOptions()
Deprecated.
Use
getOption(String) to read an option no matter where it is defined |
java.lang.Object |
getPreviousResult()
Returns the result of the previous task in this Job, if any.
|
org.quartz.JobExecutionContext |
getQuartzContext()
Returns the schedulers Quartz context.
|
java.lang.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(java.lang.Object object)
Sets the result of this task
|
public java.util.Map<java.lang.String,java.lang.String> getOptions()
getOption(String)
to read an option no matter where it is definedpublic java.lang.String getOption(java.lang.String name)
name
- Name of the optionpublic java.lang.String getOption(java.lang.String name, java.lang.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 java.lang.Object getResult()
public void setResult(java.lang.Object object)
object
- The tasks resultpublic org.apache.log4j.Logger getLog()
public java.util.Map<java.lang.String,java.lang.Object> getCustomOptions()
public java.lang.Object getPreviousResult()
public Job getCurrentJob()
public Task getCurrentTask()
public de.innovationgate.webgate.api.WGDatabase db(java.lang.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 java.util.Set<java.lang.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.public boolean isCancelable()
public void setCancelable(boolean cancelable)
public void dbUpdated(de.innovationgate.webgate.api.WGDatabase db) throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIException