/** * Create a new future. */ public Future() { if(DEBUG) { creation = new DebugException("future creation: "+this); } }
/** * Returns an OnExceptionListener that logs exceptions to console. * * @return {@link IFunctionalExceptionListener} */ public static final IFunctionalExceptionListener printExceptions() { return new IFunctionalExceptionListener() { Exception debugException = Future.DEBUG ? new DebugException() : null; public void exceptionOccurred(Exception exception) { if(Future.DEBUG) { debugException.printStackTrace(); exception.printStackTrace(); } getLogger().warning("Exception occurred: "+this+", "+ exception); } }; }
/** * */ public DelegatingTupleFuture(FutureFunctionality func) { if(func==null) throw new IllegalArgumentException("Func must not null."); this.func = func; if(Future.DEBUG) { this.creaex = new DebugException(); } }
/** * Create a new listener. * @param logger The logger. */ public DefaultResultListener(Logger logger) { this.logger = logger; if(logger==null) { this.logger = Logger.getLogger("default-result-listener"); } if(Future.DEBUG) { exception = new DebugException(); } }
final Exception ex = Future.DEBUG ? new DebugException() : null;
first = new DebugException("first result");
if(DEBUG) first = new DebugException("first setException()");
final Exception ex = Future.DEBUG ? new DebugException("Timeout: "+timeout) : null; waitForDelay(timeout, realtime) .addResultListener(new IResultListener<Void>()
stepadditions.put(step, new DebugException(step.toString()));