Class ScheduledTask
- java.lang.Object
- com.orchestranetworks.scheduler.ScheduledTask
 
 - public abstract class ScheduledTask extends Object Task definition to be executed by the EBX® task scheduler. To define a task, a concrete class extending this abstract class must be implemented. This concrete class must have a- publicno-argument constructor.- Life cycle- A - ScheduledTaskis instantiated each time a task definition is validated by EBX® and each time the execution is fired by the scheduler.- Configuration- A - ScheduledTaskcan be parameterized using JavaBean specifications (getters and setters).- Supported parameter types are: - boolean
- int
- java.lang.Boolean
- java.lang.Integer
- java.math.BigDecimal
- java.lang.String
- java.util.Date
- java.net.URI
- java.net.URL
 
-   Constructor SummaryConstructors Constructor Description ScheduledTask()
 -   Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidexecute (ScheduledExecutionContext aContext)Executes the current task.voidhandleBeforeInterrupting (ScheduledExecutionContext aContext)When a task interruption has been requested through EBX® administration, this method provides the opportunity to perform actions before actually interrupting the task execution.voidhandleBeforePausing (ScheduledExecutionContext aContext)When a pause has been requested through EBX® administration, this method provides the opportunity to perform actions before entering the pause state.voidhandleBeforeResuming (ScheduledExecutionContext aContext)When the administrator requests to resume a paused schedule task, this method provides the opportunity to perform actions before the task resumes execution.booleanisInterruptable()Iftrue, the current task can be interrupted through EBX® administration.booleanisPausable()Iftrue, the current task can be paused (and resumed) through EBX® administration.voidvalidate (ValueContextForValidation aValidationContext)Validates the current task configuration.
 
-   
-   Method Detail- validate- public void validate(ValueContextForValidation aValidationContext) Validates the current task configuration.- Called at: - task configuration in Administration > Task scheduler > Tasks,
- task instantiation in the scheduler.
 - Default implementation does nothing. To be overridden if specific checks have to be done. 
 - execute- public abstract void execute(ScheduledExecutionContext aContext) throws OperationException, ScheduledTaskInterruption Executes the current task.- The implementation of this method should not try to catch the interruption signal - ScheduledTaskInterruption.- Throws:
- OperationException
- ScheduledTaskInterruption
- See Also:
- ProgrammaticService
 
 - handleBeforeInterrupting- public void handleBeforeInterrupting(ScheduledExecutionContext aContext) throws OperationException When a task interruption has been requested through EBX® administration, this method provides the opportunity to perform actions before actually interrupting the task execution.- For instance, this may be overridden to release resources by closing open files and database connections. - In order to enable interruptions, the method - isInterruptable()must be overridden. Also, to allow interrupting, the execution method must invoke the method- ScheduledExecutionContext.handleExecutionState()where an interrupt would be acceptable.- Default implementation does nothing. - Throws:
- OperationException
- See Also:
- isInterruptable(),- ScheduledExecutionContext.handleExecutionState()
 
 - handleBeforePausing- public void handleBeforePausing(ScheduledExecutionContext aContext) throws OperationException When a pause has been requested through EBX® administration, this method provides the opportunity to perform actions before entering the pause state.- For instance, this may be overridden to release resources by closing open files and database connections. - In order to enable pauses, the method - isPausable()must be overridden. Also, to allow pausing, the execution method must invoke the method- ScheduledExecutionContext.handleExecutionState()where a pause would be acceptable.- Default implementation does nothing. If an - OperationExceptionis thrown, the task execution is interrupted.- Throws:
- OperationException
- See Also:
- isPausable(),- ScheduledExecutionContext.handleExecutionState()
 
 - handleBeforeResuming- public void handleBeforeResuming(ScheduledExecutionContext aContext) throws OperationException When the administrator requests to resume a paused schedule task, this method provides the opportunity to perform actions before the task resumes execution.- For instance, this may be overridden to acquire resources that were released after the pause by re-opening files and JDBC connections. - If an - OperationExceptionis thrown, the task execution is interrupted.- Default implementation does nothing. To be overridden if a specific behavior is required. - Throws:
- OperationException
- See Also:
- handleBeforePausing(ScheduledExecutionContext)
 
 - isInterruptable- public boolean isInterruptable() If- true, the current task can be interrupted through EBX® administration.- Default implementation returns - false.
 - isPausable- public boolean isPausable() If- true, the current task can be paused (and resumed) through EBX® administration.- Default implementation returns - false.
 
 
-