恢复购买操作
@param successCallback 恢复成功后的回调, 传值参数为上的商品列表[{标识及数量}]，和消息内容
@param failCallback 恢复失败后的回调。原失败的内容
501325
function (successCallback, failCallback) {
    var t$ = this;

    // ////////////////////////////////////////////////////////////////////////////
    var _cb = function (obj) {
      try {
        $bc_$2.IAP.NoticeCenter().remove(_cb);
        if (lodash.isObject(obj)) {
          var info = obj.info;
          var notifyType = obj.notifyType;

          if (notifyType === t$.MessageType['ProductsPaymentQueueRestoreCompleted']) {
            successCallback && successCallback(info);
          } else if (t$.MessageType['ProductsPaymentRestoreCompletedTransactionsFailed']) {
            failCallback && failCallback(info, obj);
          }
        }
      } catch (e) {
        console.error(e);
      }
    };

    // 注册一个消息回调
    $bc_$2.IAP.NoticeCenter().add(_cb);

    if ($bc_$2.pN) {
      // 发送购买请求
      $bc_$2.pN.iap.restoreIAP();
    } else {
      console.log('Romanysoft SDK simulation environment....');
      var obj = window.localStorage.getItem($bc_$2.IAP_SE_KEY);
      if (obj) {
        $bc_$2.IAP_SE_OBJ = JSON.parse(obj);
      }

      var purchasedItemList = []; // 声明原先已经购买的商品列表

      // /检测所有已经注册的ID
      lodash.each($bc_$2.IAP_SE_Wrapper.productIdentifiers, function (productID, index, list) {
        if ($bc_$2.IAP_SE_OBJ.hasOwnProperty(productID)) {
          var quantity = $bc_$2.IAP_SE_OBJ[productID];
          if (quantity > 0) {
            var purchasedItem = {
              productIdentifier: productID,
              quantity: quantity
            };

            purchasedItemList.push(purchasedItem);
          }
        }
      });

      // /模拟发送获取产品信息
      $bc_$2.IAP_SE_Wrapper.caller().fire({
        notifyType: t$.MessageType['ProductsPaymentQueueRestoreCompleted'],
        info: purchasedItemList
      });
    }
  }
139018
public void fail(Throwable ex) {
        this.done = true;
        if (this.failureHandler != null) {
            Callbacks.invokeSafely(this.failureHandler, ex, cex -> log.error("Fail Callback invocation failure.", cex));
        }
    }
10780
public void notifyFailure(final Callback<?> callback, final Throwable error) {
    invokeLater(new Runnable() {
      public void run() {
        callback.onFailure(error);
      }
    });
  }
369296
public function withCallback($successCallback, $failedCallback = null, $callbackMode = self::CALLBACK_MODE_HTTP)
    {
        $this->callback = $successCallback;
        $this->failedCallback = $failedCallback;
        $this->callbackMode = $callbackMode;

        return $this;
    }
70740
public JsonNode handleCallback(final Callback callback) {

        if (callback.getInvoke() != null) {
            return invokeCallbackMethod(callback.getInvoke(), callback.getCookie());
        } else if (callback.getGet() != null) {
            return invokeCallbackGet(callback.getGet());
        } else if (callback.getSet() != null) {
            return invokeCallbackSet(callback.getSet());
        }

        throw new JsiiException("Unrecognized callback type: get/set/invoke");
    }
289514
public void addCallback(final ClientTransport.PingCallback callback, Executor executor) {
    Runnable runnable;
    synchronized (this) {
      if (!completed) {
        callbacks.put(callback, executor);
        return;
      }
      // otherwise, invoke callback immediately (but not while holding lock)
      runnable = this.failureCause != null ? asRunnable(callback, failureCause)
                                           : asRunnable(callback, roundTripTimeNanos);
    }
    doExecute(executor, runnable);
  }
805549
function (successCallback, errorCallback, deviceId) {
		winble.logger.logApiEntry("connect");
		winble.deviceManager.connectToDevice(successCallback, errorCallback, deviceId);
		winble.logger.logApiExit("connect");
	}
921916
private void handleCallAsync(CallAsync callAsync) {
		try {
			Object result = callAsync.getCallable().call();

			getSender().tell(new Status.Success(result), getSelf());
		} catch (Throwable e) {
			getSender().tell(new Status.Failure(e), getSelf());
		}
	}
669371
@MainThread
    private void scheduleFailureCallbacks(Event event, EventFailure failure) {
        // Sending failure callback for explicit handlers of given event
        for (EventTarget target : targets) {
            for (EventMethod method : target.methods) {
                if (event.getKey().equals(method.eventKey)
                        && method.type == EventMethod.Type.FAILURE) {
                    Utils.log(event.getKey(), method, "Scheduling failure callback");
                    executionQueue.add(Task.create(this, target, method, event, failure));
                }
            }
        }

        // Sending failure callback to general handlers (with no particular event key)
        for (EventTarget target : targets) {
            for (EventMethod method : target.methods) {
                if (EventsParams.EMPTY_KEY.equals(method.eventKey)
                        && method.type == EventMethod.Type.FAILURE) {
                    Utils.log(event.getKey(), method, "Scheduling general failure callback");
                    executionQueue.add(Task.create(this, target, method, event, failure));
                }
            }
        }
    }
715743
@SuppressWarnings("unchecked")
    public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) {
        call.enqueue(new Callback() {
            @Override
            public void onFailure(Request request, IOException e) {
                callback.onFailure(new ApiException(e), 0, null);
            }

            @Override
            public void onResponse(Response response) throws IOException {
                T result;
                try {
                    result = (T) handleResponse(response, returnType);
                } catch (ApiException e) {
                    callback.onFailure(e, response.code(), response.headers().toMultimap());
                    return;
                }
                callback.onSuccess(result, response.code(), response.headers().toMultimap());
            }
        });
    }
1168835
protected final void registerCustomEventCallback(
            final CrawlEvent event,
            final PatternMatchingCallback callback) {
        Validate.notNull(event, "The event cannot be null.");
        Validate.notNull(callback, "The callback cannot be null.");

        callbackManager.addCustomEventCallback(event, callback);
    }
1211868
@Override
    public synchronized void addCallBack(RecoveryLogCallBack callback) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "addCallBack", callback);

        if (_registeredCallbacks == null) {
            _registeredCallbacks = new HashSet<RecoveryLogCallBack>();
        }

        _registeredCallbacks.add(callback);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "addCallBack");
    }
215249
private void validateExternalCallback(Method method, CallbackType callbackType) {
    Class<?>[] parameters = method.getParameterTypes();
    if (!parameters[0].isAssignableFrom(entityClass)) {
      String message = String.format("Method %s in class %s is not valid for entity %s",
          method.getName(), method.getDeclaringClass().getName(), entityClass.getName());
      throw new EntityManagerException(message);
    }
    CallbackMetadata callbackMetadata = new CallbackMetadata(EntityListenerType.EXTERNAL,
        callbackType, method);
    metadata.put(callbackType, callbackMetadata);
  }
98478
private boolean ackNoException(Channel consumerChannel, boolean msgApplied, final long deliveryTag) {
        try {
            if (msgApplied) {
                //设置multiple为true，经过压测发现有一定几率ack出现ioException的情况，这里顺带把前面的消息一起ack掉
                consumerChannel.basicAck(deliveryTag, true);
            } else {
                consumerChannel.basicNack(deliveryTag, false, true);
            }
            return true;
        } catch (Throwable unknownException) {
            LOG.error(unknownException);
            return false;
        }
    }
883629
public T validationCallback(ValidationCallback callback) {
        if (callback instanceof ApplicationContextAware) {
            ((ApplicationContextAware) callback).setApplicationContext(applicationContext);
        }

        getAction().setValidationCallback(callback);
        return self;
    }
1214504
public boolean doInnerCallback(ModificationQueue modificationQueue, SecurityContext securityContext, ErrorBuffer errorBuffer) throws FrameworkException {

		// check for modification propagation along the relationships
		if ((status & STATE_PROPAGATING_MODIFICATION) == STATE_PROPAGATING_MODIFICATION && object instanceof AbstractNode) {

			Set<AbstractNode> nodes = ((AbstractNode)object).getNodesForModificationPropagation();
			if (nodes != null) {

				for (AbstractNode node : nodes) {

					modificationQueue.propagatedModification(node);
				}
			}

		}

		// examine only the last 4 bits here
		switch (status & 0x000f) {

			case 15:
			case 14:
			case 13:
			case 12:
			case 11:
			case 10:
			case  9:
			case  8: // since all values >= 8 mean that the object was passively deleted, no action has to be taken
				 // (no callback for passive deletion!)
				break;

			case 7:	// created, modified, deleted, poor guy => no callback
				break;

			case 6: // created, modified => only creation callback will be called
				object.onCreation(securityContext, errorBuffer);
				break;

			case 5: // created, deleted => no callback
				break;

			case 4: // created => creation callback
				object.onCreation(securityContext, errorBuffer);
				break;

			case 3: // modified, deleted => deletion callback
				object.onDeletion(securityContext, errorBuffer, removedProperties);
				break;

			case 2: // modified => modification callback
				object.onModification(securityContext, errorBuffer, modificationQueue);
				break;

			case 1: // deleted => deletion callback
				object.onDeletion(securityContext, errorBuffer, removedProperties);
				break;

			case 0:	// no action, no callback
				break;

			default:
				break;
		}

		// mark as finished
		modified = false;

		return !errorBuffer.hasError();
	}
964923
public List getFailureReason() {
    List fr =  (List)jmo.getField(TrmFirstContactAccess.BODY_CLIENTATTACHREPLY_FAILUREREASON);
    if (fr != null) {
      return new ArrayList(fr);
    } else {
      return null;
    }
  }