|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.server.AbstractResultSender
public abstract class AbstractResultSender
| Field Summary | |
|---|---|
protected boolean |
asynch
Determines whether results can be sent asynchronously, or if we must wait until all tasks have been completed. |
protected SerializationHelper |
helper
Used to serialize and deserialize the tasks data. |
protected SocketWrapper |
socketClient
The socket client used to communicate over a socket connection. |
| Constructor Summary | |
|---|---|
AbstractResultSender(SocketWrapper socketClient,
boolean asynch)
Initialize this result sender with a specified socket client. |
|
| Method Summary | |
|---|---|
protected int |
getPendingTasksCount()
Get the number of tasks that haven't yet been executed. |
protected List<BundleWrapper> |
getResultList()
Get the list of task bundles whose execution has been completed. |
void |
run(int count)
Wait for executed task bundles and send them back to the client. |
abstract void |
sendPartialResults(BundleWrapper bundle)
Send the results of the tasks in a bundle back to the client who submitted the request. |
protected void |
setPendingTasksCount(int pendingTasksCount)
Set the number of tasks that haven't yet been executed. |
protected void |
setResultList(List<BundleWrapper> resultList)
Set the list of task bundles whose execution has been completed. |
void |
taskCompleted(BundleWrapper result)
Callback method invoked when the execution of a task has completed. |
void |
waitForExecution()
This method waits until all tasks of a request have been completed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SerializationHelper helper
protected SocketWrapper socketClient
protected boolean asynch
| Constructor Detail |
|---|
public AbstractResultSender(SocketWrapper socketClient,
boolean asynch)
socketClient - the socket client used to send results back.asynch - determines whether results can be sent asynchronously,
or if it must wait until all tasks have been completed.| Method Detail |
|---|
public void run(int count)
throws Exception
count - the number of tasks that must be executed.
Exception - if an error occurs while sending one or more task bundles.
public abstract void sendPartialResults(BundleWrapper bundle)
throws Exception
bundle - the bundle to get the task results from.
Exception - if an IO exception occurred while sending the results back.
public void waitForExecution()
throws Exception
Exception - if handing of the results fails.public void taskCompleted(BundleWrapper result)
taskCompleted in interface TaskCompletionListenerresult - the result of the task's execution.protected void setPendingTasksCount(int pendingTasksCount)
pendingTasksCount - the number of tasks as an int.protected int getPendingTasksCount()
protected void setResultList(List<BundleWrapper> resultList)
resultList - a list of BundleWrapper instances.protected List<BundleWrapper> getResultList()
JPPFTaskBundle instances.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||