/** * Executes all scheduled {@link ScheduledCommand}s that have been passed to this scheduler, * then removes all commands. * * <p>After this method completes, {@link #getScheduledCommands} returns only the commands * that have been scheduled by the initial commands. * * @return whether new commands have been scheduled after the execution */ public boolean executeScheduledCommands() { List<ScheduledCommand> commands = new ArrayList<ScheduledCommand>(scheduledCommands); scheduledCommands.clear(); for (ScheduledCommand command : commands) { try { command.execute(); } catch (Throwable e) { GWT.reportUncaughtException(e); } } return !scheduledCommands.isEmpty(); }
/** * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands * newly scheduled by the initial commands. Removes the commands that returned {@code false}. * * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands * that are still scheduled. * * @return whether some commands are still scheduled (returned {@code true}) or * new commands have been scheduled after the execution */ public boolean executeRepeatingCommands() { List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands); repeatingCommands.clear(); for (RepeatingCommand command : commands) { boolean reschedule; try { reschedule = command.execute(); } catch (Throwable e) { reschedule = false; GWT.reportUncaughtException(e); } if (reschedule) { repeatingCommands.add(command); } } return !repeatingCommands.isEmpty(); }
/** * Handles StorageEvents if a {@link StorageEvent.Handler} is registered. */ protected static final void handleStorageEvent(StorageEvent event) { if (!hasStorageEventHandlers()) { return; } for (StorageEvent.Handler handler : storageEventHandlers) { try { handler.onStorageChange(event); } catch (Throwable t) { GWT.reportUncaughtException(t); } } }
private void onLoadImpl(int fragment) { fragmentHasLoaded(fragment); Object[] callbacks = allCallbacks[fragment]; if (callbacks != null) { logEventProgress("runCallbacks" + fragment, "begin"); allCallbacks[fragment] = null; for (Object callback : callbacks) { try { ((RunAsyncCallback) callback).onSuccess(); } catch (Throwable t) { GWT.reportUncaughtException(t); } } logEventProgress("runCallbacks" + fragment, "end"); } }
/** * Executes all scheduled {@link ScheduledCommand}s that have been passed to this scheduler, * then removes all commands. * * <p>After this method completes, {@link #getScheduledCommands} returns only the commands * that have been scheduled by the initial commands. * * @return whether new commands have been scheduled after the execution */ public boolean executeScheduledCommands() { List<ScheduledCommand> commands = new ArrayList<ScheduledCommand>(scheduledCommands); scheduledCommands.clear(); for (ScheduledCommand command : commands) { try { command.execute(); } catch (Throwable e) { GWT.reportUncaughtException(e); } } return !scheduledCommands.isEmpty(); }
/** * Executes all scheduled {@link ScheduledCommand}s that have been passed to this scheduler, * then removes all commands. * * <p>After this method completes, {@link #getScheduledCommands} returns only the commands * that have been scheduled by the initial commands. * * @return whether new commands have been scheduled after the execution */ public boolean executeScheduledCommands() { List<ScheduledCommand> commands = new ArrayList<ScheduledCommand>(scheduledCommands); scheduledCommands.clear(); for (ScheduledCommand command : commands) { try { command.execute(); } catch (Throwable e) { GWT.reportUncaughtException(e); } } return !scheduledCommands.isEmpty(); }
/** * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands * newly scheduled by the initial commands. Removes the commands that returned {@code false}. * * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands * that are still scheduled. * * @return whether some commands are still scheduled (returned {@code true}) or * new commands have been scheduled after the execution */ public boolean executeRepeatingCommands() { List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands); repeatingCommands.clear(); for (RepeatingCommand command : commands) { boolean reschedule; try { reschedule = command.execute(); } catch (Throwable e) { reschedule = false; GWT.reportUncaughtException(e); } if (reschedule) { repeatingCommands.add(command); } } return !repeatingCommands.isEmpty(); }
/** * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands * newly scheduled by the initial commands. Removes the commands that returned {@code false}. * * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands * that are still scheduled. * * @return whether some commands are still scheduled (returned {@code true}) or * new commands have been scheduled after the execution */ public boolean executeRepeatingCommands() { List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands); repeatingCommands.clear(); for (RepeatingCommand command : commands) { boolean reschedule; try { reschedule = command.execute(); } catch (Throwable e) { reschedule = false; GWT.reportUncaughtException(e); } if (reschedule) { repeatingCommands.add(command); } } return !repeatingCommands.isEmpty(); }
/** * Handles StorageEvents if a {@link StorageEvent.Handler} is registered. */ protected static final void handleStorageEvent(StorageEvent event) { if (!hasStorageEventHandlers()) { return; } for (StorageEvent.Handler handler : storageEventHandlers) { try { handler.onStorageChange(event); } catch (Throwable t) { GWT.reportUncaughtException(t); } } }
/** * Handles StorageEvents if a {@link StorageEvent.Handler} is registered. */ protected static final void handleStorageEvent(StorageEvent event) { if (!hasStorageEventHandlers()) { return; } for (StorageEvent.Handler handler : storageEventHandlers) { try { handler.onStorageChange(event); } catch (Throwable t) { GWT.reportUncaughtException(t); } } }
@Override public void onFailure(Throwable caught) { if (caught instanceof StatusCodeException) { GWT.reportUncaughtException(caught); } else { for (Request request : this.requests) { if (request.param.getCallbacks().isEmpty()) { GWT.reportUncaughtException(caught); } for (AsyncCallback requestCallback : request.param.getCallbacks()) { requestCallback.onFailure(caught); } } if (this.callback != null) { this.callback.onFailure(caught); } } } }
@Override public void onFailure(Throwable caught) { if (caught instanceof StatusCodeException) { GWT.reportUncaughtException(caught); } else { for (Request request : this.requests) { if (request.param.getCallbacks().isEmpty()) { GWT.reportUncaughtException(caught); } for (AsyncCallback requestCallback : request.param.getCallbacks()) { requestCallback.onFailure(caught); } } if (this.callback != null) { this.callback.onFailure(caught); } } } }
@Override public void onFailure(Method method, Throwable exception) { fireResponseEvent(method); boolean caught = false; for (MethodCallback<T> methodCallback : callbackList) { try { methodCallback.onFailure(method, exception); caught = true; } catch (RuntimeException e) { // Exception not handled. continue; } } if (!caught) { GWT.reportUncaughtException(exception); } } }
private void onLoadImpl(int fragment) { fragmentHasLoaded(fragment); Object[] callbacks = allCallbacks[fragment]; if (callbacks != null) { logEventProgress("runCallbacks" + fragment, "begin"); allCallbacks[fragment] = null; for (Object callback : callbacks) { try { ((RunAsyncCallback) callback).onSuccess(); } catch (Throwable t) { GWT.reportUncaughtException(t); } } logEventProgress("runCallbacks" + fragment, "end"); } }
private void onLoadImpl(int fragment) { fragmentHasLoaded(fragment); Object[] callbacks = allCallbacks[fragment]; if (callbacks != null) { logEventProgress("runCallbacks" + fragment, "begin"); allCallbacks[fragment] = null; for (Object callback : callbacks) { try { ((RunAsyncCallback) callback).onSuccess(); } catch (Throwable t) { GWT.reportUncaughtException(t); } } logEventProgress("runCallbacks" + fragment, "end"); } }
GWT.reportUncaughtException(response.getThrown());