|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
Acts as a conduit for tasks being submitted to the service instances.
Enables the client to manage its workload.
Created by invoking Connection.createSession
.
You can specify the following attributes when creating your Session:
Session.RECEIVE_SYNC
, which means that you
will send and receive your task results synchronously.
Connection
,
Connection.createSession(SessionCreationAttributes)
Field Summary | |
---|---|
static long |
FETCH_RESULTS_DIRECTLY
This informs the API that the client expects that results will only be returned to the middleware upon the explicit request of the client. |
static long |
PARTIAL_ASYNC
Flag to indicate that the Session will send its input
synchronously, but receive its output asynchronously. |
static long |
RECEIVE_ASYNC
Flag to indicate that the client expects the result of its computation to be returned to the client in an asynchronous manner. |
static long |
RECEIVE_SYNC
Flag to indicate that the client expects the result of its computation to be returned in a synchronous manner. |
static long |
SEND_OVERLAPPED
Flag to indicate that the client requires the submission of input to be in an overlapped manner. |
static long |
SEND_SYNC
Flag to indicate that the client requires the submission of input to be in a synchonous manner. |
static long |
SYNC
Flag to indicate that the Session will send its input and
receive its output synchronously. |
Method Summary | |
---|---|
void |
close()
Closes this Session (mandatory). |
void |
close(long closeFlags)
Closes this Session (mandatory). |
EnumItems |
fetchTaskOutput(long countMax)
Blocks indefinitely until countMax task responses are ready. |
EnumItems |
fetchTaskOutput(long countMax,
int timeoutInSeconds)
If countMax task responses are ready before the timeout occurs,
this method will return with all countMax responses as soon as
they are available; otherwise, this method will block for up to
timeoutInSeconds seconds and return with the responses that are
available at timeout (will be between 0 and countMax responses,
inclusive). |
EnumItems |
fetchTaskOutput(TaskOutputFilter filter)
Retrieves the task outputs that match the specified filter. |
EnumItems |
fetchTaskOutput(TaskOutputFilter filter,
int timeoutInSeconds)
Retrieves the task outputs that match the specified filter. |
java.lang.String |
getId()
Returns the identier for this Session . |
TaskInputHandle |
sendTaskInput(Message taskInput)
Delivers the provided task input message to the middleware. |
TaskInputHandle |
sendTaskInput(Message taskInput,
boolean hasPriority)
Delivers the provided task input message to the middleware. |
TaskInputHandle |
sendTaskInput(java.io.Serializable inputObj)
Delivers the provided task input object to the middleware. |
TaskInputHandle |
sendTaskInput(java.io.Serializable inputObj,
boolean hasPriority)
Delivers the provided task input object to the middleware. |
TaskInputHandle |
sendTaskInput(TaskSubmissionAttributes attributes)
Delivers the provided task input attributes to the middleware. |
void |
update(SessionUpdateAttributes attributes)
\brief Updates the session with the provided attributes. |
Field Detail |
---|
static final long SEND_SYNC
static final long SEND_OVERLAPPED
Session.sendTaskInput
will *not* block the
client's thread. The client is then free send the next task immediately and get the status of the
submission of the input at a later time from the returned TaskInputHandle
object.
static final long FETCH_RESULTS_DIRECTLY
RECEIVE_SYNC
flag.
// Set up session creation attributes
SessionCreationAttributes attributes = new SessionCreationAttributes();
attributes.setSessionName("mySession");
attributes.setSessionType("ShortRunningTasks");
attributes.setSessionFlags(RECEIVE_SYNC | FETCH_RESULTS_DIRECTLY);
// Now create session
session = connection.createSession(attributes);
fetchTaskOutput(long)
,
Constant Field Valuesstatic final long RECEIVE_SYNC
static final long RECEIVE_ASYNC
static final long SYNC
Session
will send its input and
receive its output synchronously.
static final long PARTIAL_ASYNC
Session
will send its input
synchronously, but receive its output asynchronously.
Method Detail |
---|
java.lang.String getId() throws SoamException
Session
.
This identifier can be used to allow another client to attach to this
Session
.
Session
SoamException
TaskInputHandle sendTaskInput(TaskSubmissionAttributes attributes) throws SoamException
TaskInputHandle
.
attributes
- The task input attributes to be sent through Symphony to the service.
SoamException
TaskInputHandle
TaskInputHandle sendTaskInput(java.io.Serializable inputObj) throws SoamException
TaskInputHandle
.
sendTaskInput
overload uses Native Serialization.
That is, it sends your task input to the service as a
java.io.Serializable
. If you send your task input
using this overload, you must retrieve your task input on the
service with the TaskContext.getTaskInput()
method.
sendTaskInput
overload to send your task input
as a com.platform.symphony.soam.Message
using
Symphony Serialization.
inputObj
- The task input object to be sent through Symphony to the service.
SoamException
TaskInputHandle
,
TaskContext.getTaskInput()
TaskInputHandle sendTaskInput(Message taskInput) throws SoamException
TaskInputHandle
.
sendTaskInput
overload uses Symphony Serialization.
That is, it sends your task input to the service as a
com.platform.symphony.soam.Message
. If you send your
task input using this overload, you must retrieve your task input
on the service with the TaskContext.populateTaskInput(Message)
method.
taskInput
- The input message to be sent through Symphony to the service.
SoamException
TaskInputHandle
,
TaskContext.populateTaskInput(com.platform.symphony.soam.Message)
TaskInputHandle sendTaskInput(java.io.Serializable inputObj, boolean hasPriority) throws SoamException
TaskInputHandle
.
sendTaskInput
overload uses Native Serialization.
That is, it sends your task input to the service as a
java.io.Serializable
. If you send your task input
using this overload, you must retrieve your task input on the
service with the TaskContext.getTaskInput()
method.
sendTaskInput
overload to send your task input
as a com.platform.symphony.soam.Message
using
Symphony Serialization.
inputObj
- The task input object to be sent through Symphony to the service.hasPriority
- This is used to indicate to the Middleware if the message being submitted should
take priority in the current session. When set to "true" the message will be used to
create a task which will be placed at the front of the dispatch queue.
When set to "false" the newly created task will be placed at the rear of the
dispatch queue (this is the default behavior when the overloaded form of the method is used
without specifying this parameter).
SoamException
TaskInputHandle
,
TaskContext.getTaskInput()
TaskInputHandle sendTaskInput(Message taskInput, boolean hasPriority) throws SoamException
TaskInputHandle
.
sendTaskInput
overload uses Symphony Serialization.
That is, it sends your task input to the service as a
com.platform.symphony.soam.Message
. If you send your
task input using this overload, you must retrieve your task input
on the service with the TaskContext.populateTaskInput(Message)
method.
taskInput
- The message to be sent through Symphony to the service.hasPriority
- This is used to indicate to the Middleware if the message being submitted should
take priority in the current session. When set to "true" the message will be used to
create a task which will be placed at the front of the dispatch queue.
When set to "false" the newly created task will be placed at the rear of the
dispatch queue (this is the default behavior when the overloaded form of the method is used
without specifying this parameter).
SoamException
TaskInputHandle
,
TaskContext.populateTaskInput(com.platform.symphony.soam.Message)
EnumItems fetchTaskOutput(long countMax) throws SoamException
countMax
task responses are ready.
The task responses will be returned as an enumeration.
countMax
- The maximum number of task responses to be returned by Symphony.
It must greater than or equal to 0.
EnumItems
object, which contains exactly
countMax
task responses
SoamException
EnumItems
EnumItems fetchTaskOutput(TaskOutputFilter filter) throws SoamException
FETCH_RESULTS_DIRECTLY
and
RECEIVE_SYNC
session flags.
filter
- Describes which task outputs to retrieve.
SoamException
EnumItems
,
TaskOutputFilter
EnumItems fetchTaskOutput(TaskOutputFilter filter, int timeoutInSeconds) throws SoamException
FETCH_RESULTS_DIRECTLY
and
RECEIVE_SYNC
session flags.
filter
- Describes which task outputs to retrieve.timeoutInSeconds
- Time to wait before giving up on trying to fulfill the request.
Valid values are:
SoamException
EnumItems
,
TaskOutputFilter
EnumItems fetchTaskOutput(long countMax, int timeoutInSeconds) throws SoamException
countMax
task responses are ready before the timeout occurs,
this method will return with all countMax
responses as soon as
they are available; otherwise, this method will block for up to
timeoutInSeconds
seconds and return with the responses that are
available at timeout (will be between 0 and countMax
responses,
inclusive).
countMax
- The maximum number of task responses to be returned by Symphony.
It must greater than or equal to 0.timeoutInSeconds
- How much time should pass before giving up
on trying to fulfill the request. Value must be between 0 and
31556926 seconds inclusive.
EnumItems
object, which contains up to
countMax
task responses
SoamException
EnumItems
void close() throws SoamException
Session
(mandatory).
SoamException
void close(long closeFlags) throws SoamException
Session
(mandatory).
closeFlags
- This flag allows the client to specify explicitly what
action to take during the closing of the session.
The supported flags are as follows:
SessionCloseFlags.DESTROY_ON_CLOSE
This informs the API
that the client no longer intends to use the session.
This is the default behaviour if the Session.close()
overload is used. Closing the session in this way will result in the
session being terminated within the middleware. All outstanding results
will be discarded.
SessionCloseFlags.DETACH_ON_CLOSE
This informs the API
that the client no longer intends to use the session locally,
but intends for the workload to continue running within the middleware.
A client must call Connection.openSession
to gain access
to this session once it has been closed with this flag.
SoamException
SessionCloseFlags
,
Connection.openSession(SessionOpenAttributes)
void update(SessionUpdateAttributes attributes) throws SoamException
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. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |