interface IO2GResponseListener
Brief
The interface provides method signatures to process notifications about request completions, request failures and tables updates.
Details
Responses come from the trading server in two ways:
A response provided by the server as an answer to a user request.
Requests may be successfully completed or failed:
- to process notifications about successful request completion, you must use the onRequestCompleted method;
- to process notifications about requests failures, you must use the onRequestFailed method.
A response provided by the server as a result of trading tables updates.
To process these notifications, you must use the
onTablesUpdates method.
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 type defined in the fxcore2.dll
assembly.
The namespace is fxcore2
.
Public Methods | |
Processes a notification about a successful request completion. |
|
Processes a notification about a request failure. |
|
Processes notifications about tables updates. |