Package com.almende.eve.transform.rpc.formats

Examples of com.almende.eve.transform.rpc.formats.JSONRequest


   *             Signals that an I/O exception has occurred.
   */
  public static String invoke(final Object destination, final String request,
      final RequestParams requestParams, final Authorizor auth)
      throws IOException {
    JSONRequest jsonRequest = null;
    JSONResponse jsonResponse = null;
    try {
      jsonRequest = new JSONRequest(request);
      jsonResponse = invoke(destination, jsonRequest, requestParams, auth);
    } catch (final JSONRPCException err) {
      jsonResponse = new JSONResponse(err);
    }
   
View Full Code Here


    try {
      id = JOM.getInstance().valueToTree(new UUID().toString());
    } catch (final Exception e) {
      LOG.log(Level.SEVERE, "Failed to generate UUID for request", e);
    }
    return new JSONRequest(id, method.getName(), params);
  }
View Full Code Here

        if (json != null) {
          if (JSONRPC.isResponse(json)) {
            final JSONResponse response = new JSONResponse(json);
            jsonMsg = response;
          } else if (JSONRPC.isRequest(json)) {
            final JSONRequest request = new JSONRequest(json);
            jsonMsg = request;
          } else {
            LOG.warning("Message contains valid JSON, but is not JSON-RPC:"
                + json);
          }
View Full Code Here

      return null;
    }
    final JsonNode id = jsonMsg.getId();
    try {
      if (jsonMsg.isRequest()) {
        final JSONRequest request = (JSONRequest) jsonMsg;
        final RequestParams params = new RequestParams();
        params.put(Sender.class, senderUrl.toASCIIString());
        return JSONRPC.invoke(destination.get(), request, params, auth);
      } else if (jsonMsg.isResponse() && callbacks != null && id != null
          && !id.isNull()) {
View Full Code Here

   *            the params
   * @return the JSON request
   */
  public <T> JSONRequest buildMsg(final String method,
      final ObjectNode params) {
    return new JSONRequest(method, params);
  }
View Full Code Here

   *            the callback
   * @return the JSON request
   */
  public <T> JSONRequest buildMsg(final String method,
      final ObjectNode params, final AsyncCallback<T> callback) {
    final JSONRequest request = new JSONRequest(method, params);
    addCallback(request, callback);
    return request;
  }
View Full Code Here

   *            the callback
   * @return the JSON request
   */
  public <T> JSONRequest buildMsg(final Method method, final Object[] params,
      final AsyncCallback<T> callback) {
    final JSONRequest request = JSONRPC.createRequest(method, params);
    addCallback(request, callback);
    return request;
  }
View Full Code Here

TOP

Related Classes of com.almende.eve.transform.rpc.formats.JSONRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.