public void run() { customResultAvailable(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); } }); } }