Examples of RpcRequestHandler


Examples of com.linkedin.r2.transport.common.RpcRequestHandler

  @SuppressWarnings("deprecation")
  public void handleRpcRequest(RpcRequest req, Map<String, String> wireAttrs,
                               TransportCallback<RpcResponse> callback)
  {
    final URI address = req.getURI();
    final RpcRequestHandler handler = _rpcHandlers.get(address);

    if (handler == null)
    {
      final Exception ex = new Exception("No dispatcher for URI '" + address + "'");
      callback.onResponse(TransportResponseImpl.<RpcResponse>error(ex));
      return;
    }

    try
    {
      handler.handleRequest(req, new TransportCallbackAdapter<RpcResponse>(callback));
    }
    catch (Exception e)
    {
      callback.onResponse(TransportResponseImpl.<RpcResponse>error(e));
    }
View Full Code Here

Examples of com.linkedin.r2.transport.common.RpcRequestHandler

      callback.onError(new RuntimeException("URI is missing path information for dispatch: " + req.getURI()));
      return;
    }

    final String methodName = pathSegs[pathSegs.length - 1];
    final RpcRequestHandler method = _methods.get(methodName);
    if (method == null)
    {
      callback.onError(new RuntimeException("No method handler registered for: " + methodName));
      return;
    }

    method.handleRequest(req, callback);
  }
View Full Code Here

Examples of com.linkedin.r2.transport.common.RpcRequestHandler

  @Deprecated
  @SuppressWarnings("deprecation")
  public void handleRpcRequest(RpcRequest req, Map<String, String> wireAttrs,
                               TransportCallback<RpcResponse> callback)
  {
    final RpcRequestHandler handler = getHandler(req.getURI(), _rpcHandlers,
            DEFAULT_RPC_HANDLER);

    try
    {
      handler.handleRequest(req, new TransportCallbackAdapter<RpcResponse>(callback));
    }
    catch (Exception e)
    {
      callback.onResponse(TransportResponseImpl.<RpcResponse>error(e));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.