protected RspList<T> doAndComplete(Callable<RspList<T>> supplier) { try { return supplier.call(); } catch(Throwable t) { complete(this.rsps); return this.rsps; } finally { corrDone(); } }
protected void sendRequest(Buffer data, final Collection<Address> targetMembers) throws Exception { try { corr.sendRequest(targetMembers, data, options.mode() == ResponseMode.GET_NONE? null : this, options); } catch(Exception ex) { corrDone(); throw ex; } }
/** Marks all responses with an exception (unless a response was already marked as done) */ public void transportClosed() { boolean changed=false; lock.lock(); try { for(Map.Entry<Address, Rsp<T>> entry: rsps.entrySet()) { Rsp<T> rsp=entry.getValue(); if(rsp != null && !(rsp.wasReceived() || rsp.wasSuspected() || rsp.wasUnreachable())) { rsp.setException(new IllegalStateException("transport was closed")); num_received++; changed=true; } } if(changed && responsesComplete()) { complete(this.rsps); corrDone(); } } finally { lock.unlock(); } }
protected RspList<T> doAndComplete(Callable<RspList<T>> supplier) { try { return supplier.call(); } catch(Throwable t) { complete(this.rsps); return this.rsps; } finally { corrDone(); } }
protected void sendRequest(Buffer data, final Collection<Address> targetMembers) throws Exception { try { corr.sendRequest(targetMembers, data, options.mode() == ResponseMode.GET_NONE? null : this, options); } catch(Exception ex) { corrDone(); throw ex; } }
/** Marks all responses with an exception (unless a response was already marked as done) */ public void transportClosed() { boolean changed=false; lock.lock(); try { for(Map.Entry<Address, Rsp<T>> entry: rsps.entrySet()) { Rsp<T> rsp=entry.getValue(); if(rsp != null && !(rsp.wasReceived() || rsp.wasSuspected() || rsp.wasUnreachable())) { rsp.setException(new IllegalStateException("transport was closed")); num_received++; changed=true; } } if(changed && responsesComplete()) { complete(this.rsps); corrDone(); } } finally { lock.unlock(); } }