public boolean dispatchCancelled() { return dispatch(new CancelledEvent(request)); }
public static ResponseMessage getResponseMessage(Event event) throws InterruptedException, ExecutionException, TimeoutException { if (event == null) throw new NullPointerException("event cannot be null"); switch (event.getType()) { case RESULT: case FAULT: return ((AbstractResponseEvent<?>)event).getResponse(); case FAILURE: throw new ExecutionException(((FailureEvent)event).getCause()); case TIMEOUT: throw new TimeoutException(((TimeoutEvent)event).toString()); case CANCELLED: throw new InterruptedException(((CancelledEvent)event).toString()); default: { RuntimeException e = new RuntimeException("Unknown event type: " + event); log.error(e, ""); throw e; } } } }
public static ResponseMessage getResponseMessage(Event event) throws InterruptedException, ExecutionException, TimeoutException { if (event == null) throw new NullPointerException("event cannot be null"); switch (event.getType()) { case RESULT: case FAULT: return ((AbstractResponseEvent<?>)event).getResponse(); case FAILURE: throw new ExecutionException(((FailureEvent)event).getCause()); case TIMEOUT: throw new TimeoutException(((TimeoutEvent)event).toString()); case CANCELLED: throw new InterruptedException(((CancelledEvent)event).toString()); default: { RuntimeException e = new RuntimeException("Unknown event type: " + event); log.error(e, ""); throw e; } } } }
public boolean dispatchCancelled() { return dispatch(new CancelledEvent(request)); }
public static ResponseMessage getResponseMessage(Event event) throws InterruptedException, ExecutionException, TimeoutException { if (event == null) throw new NullPointerException("event cannot be null"); switch (event.getType()) { case RESULT: case FAULT: return ((AbstractResponseEvent<?>)event).getResponse(); case FAILURE: throw new ExecutionException(((FailureEvent)event).getCause()); case TIMEOUT: throw new TimeoutException(((TimeoutEvent)event).toString()); case CANCELLED: throw new InterruptedException(((CancelledEvent)event).toString()); default: { RuntimeException e = new RuntimeException("Unknown event type: " + event); log.error(e, ""); throw e; } } } }
public boolean dispatchCancelled() { return dispatch(new CancelledEvent(request)); }