Visit Platform at http://www.platform.com

Platform Symphony 4.1 Java API Reference

com.platform.symphony.soam
Interface TaskOutputHandle


public interface TaskOutputHandle

A task response that consists of a task identifier, an output from the service (if any), and an exception (if any).

For synchronous retrieval of task responses, Session.fetchTaskOutput can be invoked to retrieve an EnumItems object, which contains a series of TaskOutputHandles. You can enumerate through this object by calling EnumItems.getNext.

For asynchronous processing of task responses, the TaskOutputHandle will be passed into the SessionCallback.onResponse method when that task has completed.

See Also:
Session.fetchTaskOutput(long), SessionCallback, EnumItems.getNext(), TaskInputHandle

Method Summary
 SoamException getException()
          Retrieves the attached exception if the task was unsuccessful.
 java.lang.String getId()
          Returns the task identifier for this task.
 java.lang.Object getTaskOutput()
          Retrieves the task output object that was passed back to the client from the service.
 boolean isSuccessful()
          Indicates whether the corresponding task was successfully processed by the service instance.
 void populateTaskOutput(Message message)
          Populates message with the task result that was passed back to the client from the service.
 

Method Detail

getId

java.lang.String getId()
                       throws SoamException
Returns the task identifier for this task.
This task ID can be compared to the task ID from a TaskInputHandle within the same Session to match the input from a client to the output retrieved from the service.

Returns:
The task identifier for this TaskOutputHandle
Throws:
SoamException
See Also:
Session.sendTaskInput(com.platform.symphony.soam.TaskSubmissionAttributes), Session.fetchTaskOutput(long), TaskInputHandle.getId()

isSuccessful

boolean isSuccessful()
                     throws SoamException
Indicates whether the corresponding task was successfully processed by the service instance.

Returns:
true if the task was successfully processed, false otherwise.
Throws:
SoamException

populateTaskOutput

void populateTaskOutput(Message message)
                        throws SoamException
Populates message with the task result that was passed back to the client from the service.

If the task failed and this method is called, an exception will be thrown. Avoid erroneously calling this method by invoking TaskOutputHandle.isSuccessful to verify that the task had succeeded.

IMPORTANT NOTE:
If you sent your task output as a com.platform.symphony.soam.Message using Symphony Serialization, you must use this method to retrieve it.
If you sent your task output as a java.io.Serializable using Native Serialization, use the getTaskOutput method instead.

Parameters:
message - The message to populate.
Throws:
SoamException
See Also:
TaskContext.setTaskOutput(Message), isSuccessful(), getTaskOutput()

getTaskOutput

java.lang.Object getTaskOutput()
                               throws SoamException
Retrieves the task output object that was passed back to the client from the service.

If the task failed and this method is called, an exception will be thrown. Avoid erroneously calling this method by invoking TaskOutputHandle.isSuccessful to verify that the task had succeeded.

IMPORTANT NOTE:
If you sent your task output as a java.io.Serializable using Native Serialization, you must use this method to retrieve it.
If you sent your task output as a com.platform.symphony.soam.Message using Symphony Serialization, use the populateTaskOutput method instead.

Returns:
The task output object.
Throws:
SoamException
See Also:
TaskContext.setTaskOutput(Serializable), isSuccessful(), populateTaskOutput(com.platform.symphony.soam.Message)

getException

SoamException getException()
                           throws SoamException
Retrieves the attached exception if the task was unsuccessful.

If the task succeeded and this method is called, an exception will be thrown. Avoid erroneously calling this method by invoking TaskOutputHandle.isSuccessful to verify that the task had failed.

Returns:
The exception object generated by Symphony or the service.
Throws:
SoamException
See Also:
isSuccessful()

Version 4.1
Date Modified: -DREL_DATE=Nov 03 2008
Platform Computing. Accelerating Intelligence(TM).
Copyright (C) 2001-2008 Platform Computing Corporation. All rights reserved.