Package org.jppf.client.concurrent
Interface TaskConfiguration
public interface TaskConfiguration
This interface defines the properties that can be provided to a task
submitted by a
JPPFExecutorService and that is not a Task instance.
These properties include:
- the task expiration schedule
- a callback that will replace the task's
onTimeout()method - a callback that will replace the task's
onCancel()method
- Author:
- Laurent Cohen
-
Method Summary
Modifier and TypeMethodDescriptionorg.jppf.client.taskwrapper.JPPFTaskCallback<Object>Get the delegate for theonCancel()method.org.jppf.client.taskwrapper.JPPFTaskCallback<Object>Get the delegate for theonTimeout()method.org.jppf.scheduling.JPPFScheduleGet the timeout set on the task.setOnCancelCallback(org.jppf.client.taskwrapper.JPPFTaskCallback<Object> cancelCallback) Set the delegate for theonCancel()method.setOnTimeoutCallback(org.jppf.client.taskwrapper.JPPFTaskCallback<Object> timeoutCallback) Set the delegate for theonTimeout()method.setTimeoutSchedule(org.jppf.scheduling.JPPFSchedule timeoutSchedule) Set the timeout set on the task.
-
Method Details
-
getOnCancelCallback
org.jppf.client.taskwrapper.JPPFTaskCallback<Object> getOnCancelCallback()Get the delegate for theonCancel()method.- Returns:
- a
JPPFTaskCallbackinstance.
-
setOnCancelCallback
TaskConfiguration setOnCancelCallback(org.jppf.client.taskwrapper.JPPFTaskCallback<Object> cancelCallback) Set the delegate for theonCancel()method.- Parameters:
cancelCallback- aJPPFTaskCallbackinstance.- Returns:
- this task configuration, for method chaining.
-
getOnTimeoutCallback
org.jppf.client.taskwrapper.JPPFTaskCallback<Object> getOnTimeoutCallback()Get the delegate for theonTimeout()method.- Returns:
- a
JPPFTaskCallbackinstance.
-
setOnTimeoutCallback
TaskConfiguration setOnTimeoutCallback(org.jppf.client.taskwrapper.JPPFTaskCallback<Object> timeoutCallback) Set the delegate for theonTimeout()method.- Parameters:
timeoutCallback- aJPPFTaskCallbackinstance.- Returns:
- this task configuration, for method chaining.
-
getTimeoutSchedule
org.jppf.scheduling.JPPFSchedule getTimeoutSchedule()Get the timeout set on the task.- Returns:
- a
JPPFScheduleinstance, or null if no timeout was set.
-
setTimeoutSchedule
Set the timeout set on the task.- Parameters:
timeoutSchedule- aJPPFScheduleinstance.- Returns:
- this task configuration, for method chaining.
-