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

Platform Symphony 5.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).

NOTE: If any of the methods of this class are called after the main(...) method exits, the client or service process may behave in an undefined manner (for example, hang or terminate abnormally).

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: Although the Symphony API currently invokes this method with a single callback thread, the number of threads used by the API to invoke this method may increase in future revisions of the API. Therefore, the developer should never assume that the invocation of this method will be done serially and should always implement this method in a thread-safe manner.

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: Although the Symphony API currently invokes this method with a single callback thread, the number of threads used by the API to invoke this method may increase in future revisions of the API. Therefore, the developer should never assume that the invocation of this method will be done serially and should always implement this method in a thread-safe manner.

Parameters:
exception - The exception that had occurred
Throws:
SoamException

Version 5.1
Date Modified: -DREL_DATE=Apr 28 2011
Platform Computing. Accelerating Intelligence(TM).
Copyright (C) 2001-2009 Platform Computing Corporation. All rights reserved.