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

Platform Symphony 4.1 Java API Reference

com.platform.symphony.soam
Class SessionCallback

java.lang.Object
  extended by com.platform.symphony.soam.SessionCallback

public abstract class SessionCallback
extends java.lang.Object

Should be extended by the application developer to define custom handling for the asynchronous receipt of task responses.

The SessionCallback should be supplied as an argument when opening or creating a Session. The callback will be invoked whenever a task belonging to the given Session has completed or returned with error.

The SessionCallback will provide the most efficient use of the middleware (as opposed to synchronous task retrieval using Session.fetchTaskOutput).

See Also:
Connection.createSession(SessionCreationAttributes), Connection.openSession(SessionOpenAttributes)

Constructor Summary
SessionCallback()
          Default Constructor
 
Method Summary
abstract  void onException(SoamException exception)
          This method is invoked when an exception occurs within the scope of the given Session.
abstract  void onResponse(TaskOutputHandle task)
          This method is invoked when a task response is available.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionCallback

public SessionCallback()
Default Constructor

Method Detail

onResponse

public abstract void onResponse(TaskOutputHandle task)
                         throws SoamException
This method is invoked when a task response is available. It must be implemented by the application developer. A task response can be an output result (in the event of success of a task) or an exception (in the event of a task failure).

NOTE: This method will be invoked by a callback thread pool within the API. Although the current thread pool has only a single thread in it, the developer should not assume that the invocation of this method will be done in a serial manner. This means that in principle, this method can be called at any time and it is the developer's responsibility to make this call thread-safe.

Parameters:
task - The task a response to be handled
Throws:
SoamException

onException

public abstract void onException(SoamException exception)
                          throws SoamException
This method is invoked when an exception occurs within the scope of the given Session. It must be implemented by the application developer.

NOTE: This method will be invoked by a callback thread pool within the API. Although the current thread pool has only a single thread in it, the developer should not assume that the invocation of this method will be done in a serial manner. This means that in principle, this method can be called at any time and it is the developer's responsibility to make this call thread-safe.

Parameters:
exception - The exception that had occurred
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.