@Override public void prepare() { super.prepare(); this.message(this.getActivity()); }
@Override public void verify() throws ConnectionCanceledException { if(SessionBackgroundAction.this.isCanceled()) { throw new ConnectionCanceledException(); } } });
@Override public void cleanup() { transcript.setLength(0); this.message(StringUtils.EMPTY); }
@Override public void prepare() { this.addListener(listener); super.prepare(); }
protected <T> boolean execute(final SessionBackgroundAction<T> action) { try { controller.background(action).get(); if(action.hasFailed()) { return false; } return true; } catch(InterruptedException | ExecutionException e) { return false; } }
@Override public void finish() { super.finish(); this.removeListener(listener); } }
@Override public boolean alert(final BackgroundException failure) { // Display alert if the action was not canceled intentionally if(this.isCanceled()) { return false; } if(log.isInfoEnabled()) { log.info(String.format("Run alert callback %s for failure %s", alert, failure)); } // Display alert if the action was not canceled intentionally return alert.alert(pool.getHost(), failure, transcript); }