JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
enhancement_small.png
CLOSED  Enhancement JPPF-494  -  Extend the driver's JobTaskListener facility
Posted Mar 19, 2017 - updated Yesterday (07:30)
action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Enhancement
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Customization
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Targetted for
    icon_milestones.png JPPF 5.2.6
Issue description
We propose the following additons to the JobTaskListener plugin:

1) Add a new callback method to the listener, called when tasks results are about to be sent back to the client:
public interface JobTasksListener extends EventListener {
  ...
 
  /**
   * Called when tasks results are about to be sent back to the client.
   * @param event encapsulates information on the tasks results.
   */
  void resultsReceived(JobTasksEvent event);
}
2) Add the job SLA and metadata to the available job information in the event:
public class JobTasksEvent extends TaskReturnEvent {
  ...
 
  /**
   * Get the job SLA from this event.
   * @return an instance of {@link JobSLA}.
   */
  public JobSLA getJobSLA()
 
  /**
   * Get the job metadata from this event.
   * @return an instance of {@link JobMetadata}.
   */
  public JobMetadata getJobMetadata()
}
3) Add the task result to each ServerTaskInformation and enable accessing it as either a stream or a deserialized Task object:
public class ServerTaskInformation implements Serializable {
  ...
 
  /**
   * Get an input stream of the task's result data, which can be desrialized as a {@link Task}.
   * @return an {@link InputStream}, or {@code null} if no result could be obtained.
   * @throws Exception if any error occurs getting the stream.
   */
  public InputStream getResultAsStream() throws Exception
 
  /**
   * Deserialize the result into a Task object.
   * @return a {@link Task}, or {@code null} if no result could be obtained.
   * @throws Exception if any error occurs deserializing the result.
   */
  public Task<?> getResultAsTask() throws Exception
}
The combination of 1) and 3) will then allow tasks results to be processed even if the client is disconnected before the job completes, provided job.getSLA().setCancelUponClientDisconnect(false) was set.

#6
Comment posted by
 lolo4j
Yesterday, 07:30
Implemented in: