interface IO2GResponseListener

Brief

The interface provides method signatures to process notifications about request completions, request failures and tables updates.

Details

The interface must be implemented by an application in order to process the trading server responses. Responses come from the trading server in two ways:

For complete details of processing the response contents, refer to the O2GResponse class documentation.

If you want to use the methods of the IO2GResponseListener interface, you must create a class that implements the interface. For example,
public class ResponseListener implements IO2GResponseListener { }

An instance of the class implementing the IO2GResponseListener interface must be subscribed to a session object. It is accomplished by calling the O2GSession.subscribeResponse method. For example,
mSession = O2GTransport.createSession();
ResponseListener responseListener = new ResponseListener(mSession);
mSession.subscribeResponse(responseListener);

The subscribed instance must be unsubscribed from a session object after calling the O2GSession.logout method, but before calling the O2GSession.dispose method. It is accomplished by calling the O2GSession.unsubscribeResponse method.
For example,

mSession.logout();
mSession.unsubscribeResponse(responseListener);
mSession.dispose();

For the interface implementation details, see the example below.

Example

Process notifications about the request to get offers and live offers updates [show]

The namespace is com.fxcore2.

Public Methods

onRequestCompleted

Processes a notification about a request successful completion.

onRequestFailed

Processes a notification about a request failure.

onTablesUpdates

Processes notifications about tables updates.

back