private void startClientSession() { Value val = getLocationValue(); JolieService.Util.getInstance().call( "startClientSession", val, new EchoesCallback() { @Override public void onSuccess( Value response ) { setWidgetValues( response ); sid = response.getFirstChild( "sid" ).intValue(); logicalClock = response.getFirstChild( "logicalClock" ).intValue(); Window.addWindowCloseListener( new WindowCloseListener() { public String onWindowClosing() { return null; } public void onWindowClosed() { closeClientSession(); } } ); } } ); }