Code example for FutureTask

Methods: run

0
		final AtomicBoolean finalSuccess = new AtomicBoolean(false);
		auth.invalidateAndRefresh(new AuthCallback() {
			// @Override 
			public void onAuthResult(boolean success) {
				finalSuccess.set(success);
				whenFinishedFuture.run();
			} 
		}); 
 
		try { 
			Log.d(LOG_TAG, "waiting for invalidate");
			whenFinishedFuture.get(AUTH_TOKEN_INVALIDATE_REFRESH_TIMEOUT,
					TimeUnit.MILLISECONDS);
			Log.d(LOG_TAG, "invalidate finished");
			return true; 
 
		} catch (InterruptedException e) {
			Log.e(LOG_TAG, "Failed to invalidate", e);
		} catch (ExecutionException e) {
			Log.e(LOG_TAG, "Failed to invalidate", e);
		} catch (TimeoutException e) {