public void transportClosed() { if(isDone()) return; completeExceptionally(new IllegalStateException("transport was closed")); corrDone(); }
protected T getResult(Callable<T> supplier) throws Exception { try { T result=supplier.call(); if(result == null && !isDone()) throw new TimeoutException("timeout waiting for response from " + target + ", request: " + toString()); return result; } catch(ExecutionException ex) { Throwable exception=ex.getCause(); if(exception instanceof Error) throw (Error)exception; else if(exception instanceof RuntimeException) throw (RuntimeException)exception; else if(exception instanceof Exception) throw (Exception)exception; else throw new RuntimeException(exception); } finally { corrDone(); } } }
@GuardedBy("lock") public boolean responsesComplete() { return options.mode() == ResponseMode.GET_NONE || isDone(); }
/** * <b>Callback</b> (called by RequestCorrelator or Transport). * Adds a response to the response table. When all responses have been received, {@code execute()} returns. */ public void receiveResponse(Object response_value, Address sender, boolean is_exception) { if(isDone()) return; if(is_exception && response_value instanceof Throwable) completeExceptionally((Throwable)response_value); else complete((T)response_value); corrDone(); }
public void siteUnreachable(String site) { if(!(target instanceof SiteAddress) || !((SiteAddress)target).getSite().equals(site) || isDone()) return; completeExceptionally(new UnreachableException(target)); corrDone(); }
/** * If the target address is not a member of the new view, we'll mark the response as suspected and unblock * the caller of execute() */ public void viewChange(View view) { if(view == null) return; // SiteAddresses are not checked as they might be in a different cluster if(!(target instanceof SiteAddress) && !view.containsMember(target) && !isDone()) { completeExceptionally(new SuspectedException(target)); corrDone(); } }
public void transportClosed() { if(isDone()) return; completeExceptionally(new IllegalStateException("transport was closed")); corrDone(); }
protected T getResult(Callable<T> supplier) throws Exception { try { T result=supplier.call(); if(result == null && !isDone()) throw new TimeoutException("timeout waiting for response from " + target + ", request: " + toString()); return result; } catch(ExecutionException ex) { Throwable exception=ex.getCause(); if(exception instanceof Error) throw (Error)exception; else if(exception instanceof RuntimeException) throw (RuntimeException)exception; else if(exception instanceof Exception) throw (Exception)exception; else throw new RuntimeException(exception); } finally { corrDone(); } } }
@GuardedBy("lock") public boolean responsesComplete() { return options.mode() == ResponseMode.GET_NONE || isDone(); }
/** * <b>Callback</b> (called by RequestCorrelator or Transport). * Adds a response to the response table. When all responses have been received, {@code execute()} returns. */ public void receiveResponse(Object response_value, Address sender, boolean is_exception) { if(isDone()) return; if(is_exception && response_value instanceof Throwable) completeExceptionally((Throwable)response_value); else complete((T)response_value); corrDone(); }
public void siteUnreachable(String site) { if(!(target instanceof SiteAddress) || !((SiteAddress)target).getSite().equals(site) || isDone()) return; completeExceptionally(new UnreachableException(target)); corrDone(); }
/** * If the target address is not a member of the new view, we'll mark the response as suspected and unblock * the caller of execute() */ public void viewChange(View view) { if(view == null) return; // SiteAddresses are not checked as they might be in a different cluster if(!(target instanceof SiteAddress) && !view.containsMember(target) && !isDone()) { completeExceptionally(new SuspectedException(target)); corrDone(); } }