org.sejda.model.task
Interface Task<T extends TaskParameters>

Type Parameters:
T - parameters type to be executed
All Known Implementing Classes:
BaseTask

public interface Task<T extends TaskParameters>

Interface to defines the task lifecycle. Generically defines the TaskParameters subclass used to parameterize the task execution. Implementing classes must define a public no-args constructor that will be reflectively invoked when the Task is executed.

Author:
Andrea Vacondio

Method Summary
 void after()
          Called after the task is executed, can be used to close resources.
 void before(T parameters)
          Called before the actual execution of the task.
 void execute(T parameters)
          Executes the task with the input parameters
 NotifiableTaskMetadata getNotifiableTaskMetadata()
           
 

Method Detail

getNotifiableTaskMetadata

NotifiableTaskMetadata getNotifiableTaskMetadata()
Returns:
The notifiable metadata for the task. All events sent for this task will include the task metadata.

before

void before(T parameters)
            throws TaskException
Called before the actual execution of the task. Can be used to perform additional validation or initialization and to deny the execution in case some requirements are not met throwing a TaskException.

Parameters:
parameters - the parameters to be executed
Throws:
TaskException - in case of unexpected errors

execute

void execute(T parameters)
             throws TaskException
Executes the task with the input parameters

Parameters:
parameters -
Throws:
TaskException

after

void after()
Called after the task is executed, can be used to close resources. This method is called in a finally block therefore it's always called even when the task execution throws an exception.



Copyright © 2013. All Rights Reserved.