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

Platform Symphony 4.1 Java API Reference

com.platform.symphony.soam
Interface TaskContext


public interface TaskContext

Provides the context for the task that is bound to the given service invocation.


Method Summary
 void discardTaskInput()
          Frees the middleware's local copy of the Task input.
 java.lang.String getSessionId()
          Returns the identifier of the Session that owns this task.
 java.lang.String getTaskId()
          Returns the identifier for this task.
 java.lang.Object getTaskInput()
          Retrieves the task input object that was sent from the client to the service.
 void populateTaskInput(Message inMsg)
          Populates inMsg with the task input that was passed from the client to the service.
 void setTaskOutput(Message outMsg)
          Sets the task output message that is to be sent back to the client.
 void setTaskOutput(java.io.Serializable outputObj)
          Sets the task output object that is to be sent back to the client.
 

Method Detail

getSessionId

java.lang.String getSessionId()
                              throws SoamException
Returns the identifier of the Session that owns this task.

Returns:
The Session identifier
Throws:
SoamException

getTaskId

java.lang.String getTaskId()
                           throws SoamException
Returns the identifier for this task.

Returns:
The identifier for this task
Throws:
SoamException

populateTaskInput

void populateTaskInput(Message inMsg)
                       throws SoamException
Populates inMsg with the task input that was passed from the client to the service.

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

Parameters:
inMsg - The message to populate.
Throws:
SoamException
See Also:
Session.sendTaskInput(Message), Session.sendTaskInput(Message, boolean)

getTaskInput

java.lang.Object getTaskInput()
                              throws SoamException
Retrieves the task input object that was sent from the client to the service.

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

Returns:
The task input object
Throws:
SoamException
See Also:
Session.sendTaskInput(Serializable), Session.sendTaskInput(Serializable, boolean)

setTaskOutput

void setTaskOutput(Message outMsg)
                   throws SoamException
Sets the task output message that is to be sent back to the client.

To retrieve this task response on the client, you must use Session.fetchTaskOutput for a synchronous Session, or implement a SessionCallback for an asynchronous Session.

IMPORTANT NOTE:
This setTaskOutput overload uses Symphony Serialization. That is, the service will send your task output to the client as a com.platform.symphony.soam.Message. If you set your task output using this overload, you must retrieve your task output on the client with the TaskOutputHandle.populateTaskOutput(Message) method.

By using Symphony Serialization, this overload provides best performance and memory usage for sending task input.

For more details, please refer to the Application Development Guide.

Parameters:
outMsg - The output message to be returned to the client
Throws:
SoamException
See Also:
Session.fetchTaskOutput(long), SessionCallback, TaskOutputHandle.populateTaskOutput(com.platform.symphony.soam.Message)

setTaskOutput

void setTaskOutput(java.io.Serializable outputObj)
                   throws SoamException
Sets the task output object that is to be sent back to the client.

To retrieve this task response on the client, you must use Session.fetchTaskOutput for a synchronous Session, or implement a SessionCallback for an asynchronous Session.

IMPORTANT NOTE:
This setTaskOutput overload uses Native Serialization. That is, the service will send your task output to the client as a java.io.Serializable. If you set your task output using this overload, you must retrieve your task output on the client with the TaskOutputHandle.getTaskOutput() method.

If you are concerned with performance or memory usage, do not use this method to set your task output. Instead, use another setTaskOutput overload to send your task output as a com.platform.symphony.soam.Message using Symphony Serialization.

For more details, please refer to the Application Development Guide.

Parameters:
outputObj - The output object to be returned to the client.
Throws:
SoamException
See Also:
Session.fetchTaskOutput(long), SessionCallback, TaskOutputHandle.getTaskOutput()

discardTaskInput

void discardTaskInput()
                      throws SoamException
Frees the middleware's local copy of the Task input.

If the developer has sucessfully extracted the Task input from the middleware and is concerned about the memory being consumed by the copy held in the middleware locally, this method can be used to free it.

NOTE:
Once the data is freed, any subsequent requests to attempt to retrieve it will result in an exception.

Throws:
SoamException

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.