private void subscribe() {
BaseExecutionContext ctx = new BaseExecutionContext();
client.subscribeToTimeTick(ctx, new Object[0],
new ExecutionObserver() {
@Override
public void onResult(ExecutionResult result) {
switch (result.getResultType()) {
case Subscription:
timeTickSubscription = result.getSubscription();
break;
case Success:
TimeTick timeTick = (TimeTick)result.getResult();
System.out.println("Time service tick: " + timeTick.getTime());
break;
case Fault:
System.out.println(result.getFault());
break;
}
}
});
client.subscribeToMatchedBet(ctx, new Object[0], new ExecutionObserver() {
@Override
public void onResult(ExecutionResult result) {
switch (result.getResultType()) {
case Subscription: