public void run() { customCommandAvailable(command); } });
public void run() { customExceptionOccurred(exception); } });
public void run() { customFinished(); } });
public void run() { customIntermediateResultAvailable(result); } });
public void run() { customResultAvailable(result); } });
/** * Called when an intermediate result is available. * @param result The result. */ public void intermediateResultAvailableIfUndone(E result) { this.undone = true; intermediateResultAvailable(result); }
/** * Declare that the future is finished. * This method is only called for intermediate futures, * i.e. when this method is called it is guaranteed that the * intermediateResultAvailable method was called for all * intermediate results before. */ public void finishedIfUndone() { this.undone = true; finished(); }
/** * Called when the result is available. * @param result The result. */ public void resultAvailableIfUndone(Collection<E> result) { this.undone = true; resultAvailable(result); }
/** * Called when an exception occurred. * @param exception The exception. */ public void exceptionOccurredIfUndone(Exception exception) { this.undone = true; exceptionOccurred(exception); }
/** * Called when an intermediate result is available. * @param result The result. */ public final void intermediateResultAvailable(final E result) { // Hack!!! When triggered from shutdown hook, swing might be terminated // and invokeLater has no effect (grrr). if(!SReflect.HAS_GUI || SwingUtilities.isEventDispatchThread())// || Starter.isShutdown()) { customIntermediateResultAvailable(result); } else { SwingUtilities.invokeLater(new Runnable() { public void run() { customIntermediateResultAvailable(result); } }); } }
/** * Called when the result is available. * This method is only called for non-intermediate futures, * i.e. when this method is called it is guaranteed that the * intermediateResultAvailable method has not been called. * @param result The final result. */ public final void resultAvailable(final Collection<E> result) { // Hack!!! When triggered from shutdown hook, swing might be terminated // and invokeLater has no effect (grrr). if(!SReflect.HAS_GUI || SwingUtilities.isEventDispatchThread())// || Starter.isShutdown()) { customResultAvailable(result); } else { SwingUtilities.invokeLater(new Runnable() { public void run() { customResultAvailable(result); } }); } }
/** * Declare that the future is finished. * This method is only called for intermediate futures, * i.e. when this method is called it is guaranteed that the * intermediateResultAvailable method was called for all * intermediate results before. */ public final void finished() { // Hack!!! When triggered from shutdown hook, swing might be terminated // and invokeLater has no effect (grrr). if(!SReflect.HAS_GUI || SwingUtilities.isEventDispatchThread())// || Starter.isShutdown()) { customFinished(); } else { SwingUtilities.invokeLater(new Runnable() { public void run() { customFinished(); } }); } }
/** * Called when a command is available. */ final public void commandAvailable(final Object command) { // Hack!!! When triggered from shutdown hook, swing might be terminated // and invokeLater has no effect (grrr). if(!SReflect.HAS_GUI || SwingUtilities.isEventDispatchThread())// || Starter.isShutdown()) // if(SwingUtilities.isEventDispatchThread()) { customCommandAvailable(command); } else { // Thread.dumpStack(); SwingUtilities.invokeLater(new Runnable() { public void run() { customCommandAvailable(command); } }); } }
/** * Called when an exception occurred. * @param exception The exception. */ public final void exceptionOccurred(final Exception exception) { // exception.printStackTrace(); // Hack!!! When triggered from shutdown hook, swing might be terminated // and invokeLater has no effect (grrr). if(!SReflect.HAS_GUI || SwingUtilities.isEventDispatchThread())// || Starter.isShutdown()) // if(SwingUtilities.isEventDispatchThread()) { customExceptionOccurred(exception); } else { SwingUtilities.invokeLater(new Runnable() { public void run() { customExceptionOccurred(exception); } }); } }