private void fail(InsertException e, ClientContext context) { // Cancel all, then call the callback synchronized(this) { if(finished) return; finished = true; } cancelAndFinish(context); cb.onFailure(e, this); }
@Override public boolean run(ClientContext context) { try { inserter.start(false, context); } catch (InsertException e) { inserter.client.onFailure(e, inserter); } return true; }
/** Called when the insert fails. */ @Override public void onFailure(InsertException e, ClientPutState state, ClientContext context) { if(logMINOR) Logger.minor(this, "onFailure() for "+this+" : "+state+" : "+e, e); synchronized(this) { finished = true; currentState = null; } client.onFailure(e, this); }
@Override public boolean run(ClientContext context) { try { inserter.start(context); } catch (InsertException e) { inserter.cb.onFailure(e, inserter); } return true; }