@Override public void routeRequest(final PresenterCommand presenterCommand) { ClientApp.make().getAsyncRunner().runAsync(new AsyncRunner.AsyncTask() { @Override public void onSuccess() { requestEventFactory.make(presenterCommand).fire(); } @Override public void onFailed(Throwable error) { LOGGER.error("Could not RunAsync request [" + presenterCommand + "]", error); } }); } }
public void configureModule(ModuleConfiguration moduleConfiguration){ ClientApp.make().configureModule(moduleConfiguration); }
public static boolean hasServiceRoot(String path){ final List<DynamicServiceRoot> serviceRoots = ClientApp.make().dominoOptions().getServiceRoots(); return serviceRoots.stream().anyMatch(r -> r.isMatchingPath(path)); } }
protected AppHistory history() { return ClientApp.make().getHistory(); } }
private void start() { fireEvent(MainDominoEvent.class, MAIN_EXTENSION_POINT_HOLDER.attribute); onApplicationStarted(); }
private V loadView() { return (V) ClientApp.make().getViewsRepository().getView(getName()); }
protected String getName() { return ClientApp.make().getPresentersRepository().getNameFromConcreteName(getConcrete()); }
@SuppressWarnings({"unchecked", "rawtypes"}) @Override protected void sendRequest(ServerRequest request, ServerRequestEventFactory requestEventFactory) { // request.headers().put("X-XSRF-TOKEN", Cookies.getCookie("XSRF-TOKEN")); ClientApp.make().getRequestRestSendersRepository().get(request.getKey()) .send(request, new ServerRequestCallBack() { @Override public void onSuccess(ResponseBean response) { requestEventFactory.makeSuccess(request, response).fire(); } @Override public void onFailure(FailedResponseBean failedResponse) { requestEventFactory.makeFailed(request, failedResponse).fire(); } }); } }
public void fireEvent(Class<? extends DominoEvent> extensionPointInterface, DominoEvent dominoEvent) { LISTENERS_REPOSITORY_HOLDER.attribute.getEventListeners(extensionPointInterface) .forEach(c -> getAsyncRunner().runAsync(() -> c.listen(dominoEvent))); }
public void run(DominoOptionsHandler dominoOptionsHandler) { dominoOptionsHandler.onBeforeRun(dominoOptions()); dominoOptions().applyOptions(); } else { INITIAL_TASKS_HOLDER.attribute.forEach(ClientStartupTask::execute); start();
@Override public void fire() { clientApp.getEventsBus().publishEvent(new GWTRequestEvent(this)); }
@Override public ClientApp build() { initClientApp(); return new ClientApp(); }
@Override public void startRouting() { state = sent; clientApp.getClientRouter().routeRequest(this); }
private void onApplicationStarted() { ApplicationStartHandler applicationStartHandler = dominoOptions().getApplicationStartHandler(); if (nonNull(applicationStartHandler)) { applicationStartHandler.onApplicationStarted(); } }
@Override public void fire() { clientApp.getEventsBus().publishEvent(new GWTRequestEvent(this)); }
protected void runAsync(AsyncRunner.AsyncTask asyncTask) { ClientApp.make().getAsyncRunner().runAsync(asyncTask); }
public static String matchedServiceRoot(String path) { final List<DynamicServiceRoot> serviceRoots = ClientApp.make().dominoOptions().getServiceRoots(); return serviceRoots.stream().filter(r -> r.isMatchingPath(path)).findFirst().orElse(defaultRoot).onMatchingPath(); }
@Override public void fire() { clientApp.getEventsBus().publishEvent(new GWTRequestEvent(this)); }
@SuppressWarnings("rawtypes") @Override public final void send(final ServerRequest request) { ClientApp.make().getAsyncRunner().runAsync(new RequestAsyncTask(request)); }