Beispiel #1
0
 public void onServiceCallFailure(AServiceCall serviceCall, List<ErrorWrapper> errors) {
   long timeFromLastSuccess = Tm.getCurrentTimeMillis() - lastSuccessfullServiceCallTime;
   if (serviceCall.isDispensable() && timeFromLastSuccess < MAX_FAILURE_TIME) {
     log.warn("Dispensable service call failed:", serviceCall, errors);
     return;
   }
   log.error("Service call failed:", serviceCall, errors);
   String serviceCallName = Str.getSimpleName(serviceCall.getClass());
   serviceCallName = Str.removeSuffix(serviceCallName, "ServiceCall");
   ScrumGwtApplication.get().handleServiceCallError(serviceCallName, errors);
 }
Beispiel #2
0
  public void onServiceCallSuccess(DataTransferObject data) {
    lastSuccessfullServiceCallTime = Tm.getCurrentTimeMillis();

    if (data.conversationNumber != null) {
      conversationNumber = data.conversationNumber;
      log.info("conversatioNumber received:", conversationNumber);
    }
    Scope.get().getComponent(Dao.class).handleDataFromServer(data);

    ScrumGwtApplication app = ScrumGwtApplication.get();
    if (data.applicationInfo != null) {
      app.applicationInfo = data.applicationInfo;
      log.debug("applicationInfo:", data.applicationInfo);
      // Scope.get().putComponent(data.applicationInfo);
    } else {
      assert app.applicationInfo != null;
    }

    new ServerDataReceivedEvent(data).fireInCurrentScope();
  }