((IUndoneResultListener<Collection<E>>)delegate).exceptionOccurredIfUndone(exception); ((IUndoneResultListener<Collection<E>>)delegate).resultAvailableIfUndone(results);
public void run() { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(e); } else { listener.exceptionOccurred(e); } } });
public void run() { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).resultAvailableIfUndone(result); } else { listener.resultAvailable(result); } }
public void run() { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(e); } else { listener.exceptionOccurred(e); } } });
/** * Called when the result is available. * @param result The result. */ public void customResultAvailable(Collection<E> result) { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<Collection<E>>)listener).resultAvailableIfUndone(result); } else { listener.resultAvailable(result); } }
((IUndoneResultListener)lis).exceptionOccurredIfUndone(fut.exception); ((IUndoneResultListener)lis).resultAvailableIfUndone(fut.result);
public void run() { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(e); } else { listener.exceptionOccurred(e); } } });
/** * Called when the result is available. * @param result The result. */ public void customResultAvailable(E result) { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).resultAvailableIfUndone(result); } else { listener.resultAvailable(result); } }
((IUndoneResultListener<E>)delegate).resultAvailableIfUndone(null); ((IUndoneResultListener<E>)delegate).exceptionOccurredIfUndone(exception);
/** * Called when an exception occurred. * @param exception The exception. */ public void customExceptionOccurred(Exception exception) { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<Collection<E>>)listener).exceptionOccurredIfUndone(exception); } else { listener.exceptionOccurred(exception); } }
/** * Called when the result is available. * @param result The result. */ public void resultAvailable(E result) { boolean notify = false; synchronized(this) { if(!notified) { notify = true; notified = true; cancel(); } } if(notify) { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).resultAvailableIfUndone(result); } else { listener.resultAvailable(result); } } }
((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(e); ((IUndoneResultListener<E>)listener).resultAvailableIfUndone(result);
/** * Called when an exception occurred. * @param exception The exception. */ public void customExceptionOccurred(Exception exception) { if(undone && listener instanceof IUndoneResultListener<?>) { ((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(exception); } else { listener.exceptionOccurred(exception); } }
/** * Called when the result is available. * @param result The result. */ public void resultAvailable(E result) { boolean notify = false; synchronized(this) { if(!notified) { notify = true; notified = true; cancel(); } } if(notify) { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).resultAvailableIfUndone(result); } else { listener.resultAvailable(result); } } }
((IUndoneResultListener)listener).exceptionOccurredIfUndone(exception); ((IUndoneResultListener)listener).resultAvailableIfUndone(result); ((IUndoneResultListener)lis).exceptionOccurredIfUndone(fut.exception); ((IUndoneResultListener)lis).resultAvailableIfUndone(fut.result);
public void run() { // try // { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(exception); } else { listener.exceptionOccurred(exception); } // } // catch(Exception e) // { // exception.printStackTrace(); // e.printStackTrace(); // } }
if(undone && delegate instanceof IUndoneResultListener) ((IUndoneResultListener<E>)delegate).resultAvailableIfUndone(null);
((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(ex); ((IUndoneResultListener<E>)listener).resultAvailableIfUndone(result); ((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(ex); ((IUndoneResultListener<E>)listener).resultAvailableIfUndone(result);
/** * Called when an exception occurred. * @param exception The exception. */ public void exceptionOccurred(Exception exception) { boolean notify = false; synchronized(this) { if(!notified) { // need to further delegate to chained listeners/futures? notify = true; notified = true; cancel(); } } if(notify) { if(undone && listener instanceof IUndoneResultListener) { ((IUndoneResultListener<E>)listener).exceptionOccurredIfUndone(exception); } else { listener.exceptionOccurred(exception); } } }
/** * Called when the result is available. * @param result The result. */ public void customResultAvailable(Collection<E> result) { if(customResultListener != null) { customResultListener.resultAvailable(result); } else { if (delegate != null) { if (undone && delegate instanceof IUndoneResultListener) { ((IUndoneResultListener) delegate).resultAvailableIfUndone(result); } else { delegate.resultAvailable(result); } } else { if (undone) { future.setResultIfUndone(result); } else { future.setResult(result); } } } }