|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface JobContext
The job context of a running job which allows the job to access the
scheduler runtime environment. Every job has a job context. The JobContext
is passed as an argument to the
onJob
method and is specific to the job that
is passed to. You are always authorized to call methods of this interface.
Note: Most of the methods of the interface throw a
SchedulerRuntimeException
which indicates a problem with the application server infrastructure.
This exception should not be caught by the implementation of a job since it
is caught by the scheduler runtime environment.
| Method Summary | |
|---|---|
JobID |
executeJob(JobDefinitionID jobDefId)
Submit a job for immediate execution. |
JobID |
executeJob(JobDefinitionID jobDefId,
JobParameter[] parameters)
Submit a job for immediate execution. |
JobID |
executeJob(String jobDefinitionName)
Submit a job for immediate execution. |
JobID |
executeJob(String jobDefinitionName,
JobParameter[] parameters)
Submit a job for immediate execution. |
com.sap.tc.logging.Category |
getCategory()
Get the category for this job which can be used to log messages in the context of the job. |
Job |
getChildJobById(JobID jobId)
Get an existing job instance by its job id. |
Job |
getJob()
Get the Job object associated with this job. |
JobDefinition |
getJobDefinition(String jobDefinitionName)
Get the JobDefinition object which represents
the job metadata for the given name |
JobParameter |
getJobParameter(String name)
Get a job parameter. |
JobParameterDefinition |
getJobParameterDefinition(String jobDefinitionName,
String parameterName)
Returns the named job definition parameter for the given job defintion which was provided when the job was deployed. |
JobParameterDefinition[] |
getJobParameterDefinitions(String jobDefinitionName)
Returns the job definitions parameters for the given job defintion which were provided when the job was deployed. |
Object |
getJobParameterGeneric(String name)
Get a job parameter. |
com.sap.tc.logging.Location |
getLocation()
Get the location that is required in order to be able to log to the Job's category. |
Logger |
getLogger()
Get a JDK-compliant Logger object. |
boolean |
isCancelled()
Returns true if the job has received a request for cancellation. |
void |
jobFailed()
This method should be called in order to indicate that this job should be set to the status ERROR
after it has been completed. |
void |
setJobParameter(JobParameter param)
Update the runtime with the given JobParameter. |
void |
setJobParameterGeneric(String name,
Object value)
Set a job parameter. |
void |
setReturnCode(short returnCode)
Set the job return code. |
void |
waitForChildJobs()
Wait for all child jobs to finish. |
void |
waitForChildJobs(JobID[] jobs)
Wait for the specified child jobs to wait for. |
boolean |
waitForChildJobs(JobID[] jobs,
long timeout)
Wait for the specified child jobs to complete. |
boolean |
waitForChildJobs(long timeout)
Wait for all child jobs to finish. |
| Method Detail |
|---|
Job getJob()
throws SchedulerRuntimeException
Job object associated with this job.
SchedulerRuntimeException - if there was a technical problem
retrieving the value
Job getChildJobById(JobID jobId)
throws SchedulerRuntimeException
jobId - the id of the job to get.
SchedulerRuntimeException - if there was a technical problem
retrieving the values
JobDefinition getJobDefinition(String jobDefinitionName)
throws SchedulerRuntimeException
JobDefinition object which represents
the job metadata for the given name
jobDefinitionName - name of the job definition
SchedulerRuntimeException - if there was a technical problem
retrieving the values
JobParameterDefinition[] getJobParameterDefinitions(String jobDefinitionName)
throws SchedulerRuntimeException
jobDefinitionName - job definition name for which to retrieve the
parameter definitions
SchedulerRuntimeException - if there was a technical problem
retrieving the values
JobParameterDefinition getJobParameterDefinition(String jobDefinitionName,
String parameterName)
throws SchedulerRuntimeException
jobDefinitionName - the name of the job definition
SchedulerRuntimeException - if there was a technical problem
retrieving the valueLogger getLogger()
com.sap.tc.logging.Category getCategory()
com.sap.tc.logging.Location getLocation()
JobParameter getJobParameter(String name)
throws IllegalArgumentException
name - the name of the parameter
JobParameter object or null if there is no such
parameter
IllegalArgumentException - if the parameter is not an IN or INOUT
parameter or if there is no such parameter
void setJobParameter(JobParameter param)
throws IllegalArgumentException,
SchedulerRuntimeException
JobParameter. The
parameter is immediately updated in the database.
param - JobParameter to update
IllegalArgumentException - if this is an IN parameter or it does
not match the job parameter definition of the job definition.
SchedulerRuntimeException - if there was a technical problem
setting the value
void setJobParameterGeneric(String name,
Object value)
throws IllegalArgumentException,
ClassCastException,
SchedulerRuntimeException
name - of the parameter
ClassCastException - if the value is of an incorrect type
IllegalArgumentException - if this is an IN parameter or it does
not match the job parameter definition of the job definition.
SchedulerRuntimeException - if there was a technical problem
setting the value
Object getJobParameterGeneric(String name)
throws IllegalArgumentException
name - the name of the parameter
IllegalArgumentException - if the parameter is not an IN or INOUT
parameter
void setReturnCode(short returnCode)
throws SchedulerRuntimeException
returnCode - the value for the return code.
SchedulerRuntimeException - if there was a technical problem
setting the return value
boolean isCancelled()
throws SchedulerRuntimeException
SchedulerRuntimeException - if there was a technical problem
retrieving the valuevoid jobFailed()
ERROR
after it has been completed.
JobID executeJob(JobDefinitionID jobDefId)
throws ParameterValidationException,
NoSuchJobDefinitionException,
SchedulerRuntimeException
jobDefId - the job definition for the job to submit
JobID object representing id of the submitted job.
ParameterValidationException - if the provided parameters
do not match the required parameters for the job
NoSuchJobDefinitionException - if there is no such job
definition or the job definition is not deployed anymore
SchedulerRuntimeException - if there was a technical problem
submitting the job.
JobID executeJob(String jobDefinitionName)
throws ParameterValidationException,
NoSuchJobDefinitionException,
SchedulerRuntimeException
jobDefinitionName - the job definition name for the job to submit
JobID object representing the if of the submitted job.
ParameterValidationException - if the provided parameters
do not match the required parameters for the job
NoSuchJobDefinitionException - if there is no such job
definition or the job definition is not deployed anymore
SchedulerRuntimeException - if there was a technical problem
submitting the job.
JobID executeJob(JobDefinitionID jobDefId,
JobParameter[] parameters)
throws ParameterValidationException,
NoSuchJobDefinitionException,
SchedulerRuntimeException
jobDefId - the job definition for the job to submitparameters - an optional list of parameter/value pairs.
JobID object representing the id of the submitted job.
ParameterValidationException - if the provided parameters
do not match the required parameters for the job
NoSuchJobDefinitionException - if there is no such job
definition or the job definition is not deployed anymore
SchedulerRuntimeException - if there was a technical problem
submitting the job.
JobID executeJob(String jobDefinitionName,
JobParameter[] parameters)
throws ParameterValidationException,
NoSuchJobDefinitionException,
SchedulerRuntimeException
jobDefinitionName - the job definition name for the job to submitparameters - an optional list of parameter/value pairs.
JobID object representing the id of the submitted job.
ParameterValidationException - if the provided parameters
do not match the required parameters for the job
NoSuchJobDefinitionException - if there is no such job
definition or the job definition is not deployed anymore
SchedulerRuntimeException - if there was a technical problem
submitting the job.void waitForChildJobs()
boolean waitForChildJobs(long timeout)
timeout - timeout for waiting, zero means no timeout
void waitForChildJobs(JobID[] jobs)
jobs - an array of child job ids
boolean waitForChildJobs(JobID[] jobs,
long timeout)
jobs - an array of child jobs to wait fortimeout - timeout for waiting, zero means no timeout
| Access Rights |
|---|
| SC | DC |
|---|---|
[sap.com] ENGFACADE
|
[sap.com] tc/je/scheduler/api
|
|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||