|
Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service 11g Release 1 (11.1.1.5) E20742-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Executable
Contract for implementing the executable for a Java job. The client
application must supply a class that implements this interface for
a request executable of job type
JAVA_TYPE
.
A client application specifies the Java executable class by setting the
the CLASS_NAME
system property,
via either metadata or at request submission. The executable class may
also implement the Cancellable
interface. The executable class
must provide an empty constructor.
When a request is ready to execute, Enterprise Scheduler will first
invoke the pre-process
callback if one was
specified when the request was submitted. If the callback indicates
that request execution should proceed, the Scheduler subsystem will
then instantiate the Executable
implementation class and call
the execute
method. Upon successful return from
execute
, the post-process
callback
will be invoked if one was specified for the request.
The execute
method is called each time the request is executed
and is passed an execution context and request parameters for the
running request. The execution context specifes the request identifer
and additional details needed if the job implementation submits
sub-requests. The manner in which execute
returns to the
caller, either by succssful return or exception, determines how the
Scheduler subsystem handles subsequent request processing.
For a given submitted request, the job executable may be called multiple
times, but usually the execution context specifies a different (child)
request identifier for each invocation. For example, if a job is
submitted with a recurring schedule, the same request executable
(class not instance) is invoked each time but with a different request
identifer. However, if a failed request is retried or a paused request
is resumed, the request identifier remains the same. A failed request
that transitions to ERROR
state may be retried depending on the
value of the RETRIES
system property.
A resumed request is one that is being re-run after previously
submitted sub-requests have completed execution.
A Java executable can submit sub-requests using
RuntimeService.submitRequest
.
It must then throw ExecutionPausedException
which causes the
request to transition to PAUSED
state. Once the sub-requests
have completed, the parent request is re-run as a resumed request.
The execution context can be used to determine if the executable is
being run as a resumed request.
Enterprise Scheduler creates a new instance of the executable class each time a submitted job request is executed. As such, the job implementation should not rely on class static or instance member variables for maintaining state.
RequestExecutionContext
,
State
Method Summary | |
---|---|
void |
execute(RequestExecutionContext context,
RequestParameters parameters)
Invoked every time the Java job request is executed. |
Method Detail |
---|
void execute(RequestExecutionContext context, RequestParameters parameters) throws ExecutionErrorException, ExecutionWarningException, ExecutionCancelledException, ExecutionPausedException
context
- the execution context for associated with
this requestparameters
- the request parameters associated with this request
ExecutionErrorException
- Should be thrown when the job
implementation detects a failure condition that it needs to
communicate to the scheduling subsystem.
The request will transition to ERROR
state.
ExecutionWarningException
- Should be thrown when the job
implementation detects a failure condition that it needs to
communicate to the scheduling subsystem.
The request will transition to WARNING
state.
ExecutionCancelledException
- Should be thrown when the job
implementation detects a condition for request cancellation that
it needs to communicate to the scheduling subsystem.
The request will transition to CANCELLED
state.
ExecutionPausedException
- Should be thrown when the job
implementation submits a sub-request and is ready to pause to
allow the sub-request to execute.
The request will transition to PAUSED
state.State
|
Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service 11g Release 1 (11.1.1.5) E20742-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |