JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   Forums 

API changes in JPPF 4.0

From JPPF 4.2 Documentation

Jump to: navigation, search

Contents

Main Page > API changes in JPPF 4.0

The new Task API

New design

In JPPF 3.x, JPPFTask was, for all practical purposes, the base class for all tasks in JPPF. Version 4.0 introduces a more generic API, based on the Task<T> interface and its concrete implementation AbstractTask<T>, with JPPFTask redefined as public class JPPFTask extends AbstractTask<Object> {}.


Most of of the API changes listed here relate to this new design, which has implications well beyond the scope of the tasks implementation.


As of JPPF 4.0, the base interface for concrete task implementations is offically Task<T>, with JPPF providing a generic abstract implementation AbstractTask<T>, which implements all methods of the interface, except the run() method inherited from the Runnable interface. All JPPF 4.0 users are strongly encouraged to use AbstractTask<T>, for consistency with the framework.

New and changed methods

In Task<T>, the methods getException() and setException(Exception) were deprecated and are now replaced with the more generic getThrowable() and setThrowable(Throwable) respectively.


Since these new methods may be inconsistent with catch(Some_Exception_Class) {} clauses in existing code, a utility class ExceptionUtils is provided, with helper methods to convert a generic Throwable into a more specfic exception type.


A new method fireNotification(Object userObject, boolean sendViaJmx) was added, which allows the tasks to send notifications to local listeners ot remote listners via JMX.

Package org.jppf.client

Class JPPFClient

submit(JPPFJob job), which returns a List<JPPFTask>, is deprecated and replaced with submitJob(JPPFJob), which returns a List<Task<?>>.


reset() and reset(TypedProperties) methods have been added.

Class AbstractJPPFClient

As for JPPFClient, the abstract definition of submit(JPPFJob job) is deprecated and replaced with the method submitJob(JPPFJob).

Class JPPFJob

addTask(Object, Object...) and addTask(String, Object, Object...), which return a JPPFTask, are deprecated and replaced with add(Object, Object...) and add(String, Object, Object...) respectively, which return a Task<?>.

Class JPPFResultCollector

getResults(), waitForResults(), and waitForResults(long), which return a List<JPPFTask>, have been deprecated and replaced with getAllResults(), awaitResults() and awaitResults(long) respectively, which return a List<Task<?>>.

Class JobResults

getAll() : Collection<JPPFTask> is replaced with getAllResults() : Collection<Task<?>>

getResult(int) : JPPFTask is deprecated and replaced with getResultTask(int) : Task<?>

putResults(List<JPPFTask>) is deprecated and replaced with addResults(List<Task<?>>)

Package org.jppf.client.event

Class JobEvent

getTasks() : List<JPPFTask> is deprecated and replaced with getJobTasks() : List<Task<?>>.

Class TaskResultEvent

getTaskList() : List<JPPFTask> is deprecated and replaced with getTasks() : List<Task<?>>.

Package org.jppf.client.persistence

Class JobPersistence

storeJob(K, JPPFJob, List<JPPFTask>) was changed into storeJob(K, JPPFJob, List<Task<?>>).

Class DefaultFilePersistenceManager

storeJob(K, JPPFJob, List<JPPFTask>) was changed into storeJob(K, JPPFJob, List<Task<?>>).

Package org.jppf.client.taskwrapper

JPPFTaskCallback

The class JPPFTaskCallback has been genericized into JPPFTaskCallback<T>.

getTask() : JPPFTask was changed into getTask() : Task<T>.

Package org.jppf.client.utils

Class ClientWithFailover

submit(JPPFJob): List<JPPFTask> is deprecated and replaced with submitJob(JPPFJob): List<Task<?>>.

Package org.jppf.server.protocol

Class CommandLineTask genericized

CommandLineTask is now defined as CommandLineTask<T> extends AbstractTask<T>.

Package org.jppf.node.event

The classes TaskExecutionListener and TaskExecutionEvent moved from package org.jppf.server.node.

Class TasKExecutionListener

The method taskNotification(TaskExecutionEvent) has been added.

TasKExecutionEvent

The method getTask() : JPPFTask was changed into getTask() : Task<?>.

Package org.jppf.jca.cci (J2E connector)

Class JPPFConnection

getSubmissionResults(String): List<JPPFTask> and waitForResults(String): List<JPPFTask> have been deprecated and replaced with getResults(String): List<Task<?>> and awaitResults(String): List<Task<?>> respectively


The method resetClient() was added.

Main Page > API changes in JPPF 4.0


JPPF Copyright © 2005-2017 JPPF.org Powered by MediaWiki