SynchronousTerminalListener

public class SynchronousTerminalListener : TerminalListener

Helper class for handle synchronous method calls in the {@link Terminal} class. Used internally by the {@link Terminal} instance to provide synchronous behavior. TimApi users can though use this class as base for their own synchronous use of the TimApi by using asynchronous function calls only. Provides the user with the ability to work also with intermediate completed request data in contrary to the synchronous method calls provided by {@link Terminal}.

The listener collects all response data received for all possible requests. The user can then examine those at a later time. The most recent request data is stored. {@link TimEvent} is not stored. Stores the last received {@link TimException}.

To use the listener call it like this:

{@code
SynchronousTerminalListener listener = new SynchronousTerminalListener();
listener.prepareWait(RequestType.TRANSACTION);
// run action potentially completing straight away
listener.waitForRequestCompleted();
// work with the result in listener
}