Examples of RemoteInvocationException


Examples of com.linkedin.r2.RemoteInvocationException

      {
        errorResponse = getErrorResponse(response);
      }
      catch (RestLiDecodingException decodingException)
      {
        return new RemoteInvocationException(decodingException);
      }

      Response<?> decodedResponse = null;
      final String header = HeaderUtil.getErrorResponseHeaderValue(response.getHeaders());

      if (header == null)
      {
        try
        {
          decodedResponse = responseDecoder.decodeResponse(response);
        }
        catch (RestLiDecodingException decodingException)
        {
          return new RemoteInvocationException(decodingException);
        }
      }

      return new RestLiResponseException(response, decodedResponse, errorResponse, e);
    }

    if (e instanceof RemoteInvocationException)
    {
      return (RemoteInvocationException) e;
    }

    return new RemoteInvocationException(e);
  }
View Full Code Here

Examples of com.linkedin.r2.RemoteInvocationException

      {
        errorResponse = getErrorResponse(restliException.getResponse());
      }
      catch (RestLiDecodingException decodingException)
      {
        return new RemoteInvocationException(decodingException);
      }

      return new RestLiResponseException(restliException.getResponse(),
                                         restliException.getDecodedResponse(),
                                         errorResponse,
                                         restliException);
    }

    return new RemoteInvocationException(e);
  }
View Full Code Here

Examples of com.linkedin.r2.RemoteInvocationException

        return _responseFuture.get(timeout, unit);
      }
    }
    catch (InterruptedException e)
    {
      throw new RemoteInvocationException(e);
    }
    catch (ExecutionException e)
    {
      // Always need to wrap it, because the cause likely came from a different thread
      // and is not suitable to throw on the current thread.
      RemoteInvocationException exception = ExceptionUtil.wrapThrowable(e.getCause());

      if (_errorHandlingBehavior == ErrorHandlingBehavior.FAIL_ON_ERROR ||
          !(exception instanceof RestLiResponseException))
      {
        throw exception;
View Full Code Here

Examples of com.linkedin.r2.RemoteInvocationException

      public void onResponse(TransportResponse<RestResponse> response)
      {
        if (response.hasError())
        {
          response =
              TransportResponseImpl.error(new RemoteInvocationException("Failed to get response from server for URI "
                                                                            + uri,
                                                                        response.getError()),
                                          response.getWireAttributes());
        }
        else if (!RestStatus.isOK(response.getResponse().getStatus()))
View Full Code Here

Examples of com.linkedin.r2.RemoteInvocationException

        if (!response.hasError())
        {
          if (!RestStatus.isOK(httpResponse.getStatus()))
          {
            newResponse =
                TransportResponseImpl.error(new RemoteInvocationException("Received error "
                                                + httpResponse.getStatus()
                                                + " from server for URI "
                                                + uri),
                                            response.getWireAttributes());
          }
          else
          {
            newResponse = TransportResponseImpl.success(new RpcResponseBuilder()
                    .setEntity(httpResponse.getEntity())
                    .build(), response.getWireAttributes());
          }
        }
        else
        {
          newResponse =
              TransportResponseImpl.error(new RemoteInvocationException("Failed to get response from server for URI "
                                                                            + uri,
                                                                        response.getError()),
                                          response.getWireAttributes());
        }
View Full Code Here

Examples of com.linkedin.r2.RemoteInvocationException

{
  @Test
  public void testFindOriginalThrowable()
  {
    ConnectException connectException = new ConnectException("Foo");
    RemoteInvocationException e = new RemoteInvocationException("Failed to get connect to a server", connectException);
    Throwable throwable = LoadBalancerUtil.findOriginalThrowable(e);

    Assert.assertEquals(throwable, connectException);

    //we only go as far as 100 level deep for finding exception
    Exception npe = new NullPointerException();
    Exception temp = npe;
    for (int i = 0; i < 100; i++)
    {
      e = new RemoteInvocationException(temp);
      temp = e;
    }

    throwable = LoadBalancerUtil.findOriginalThrowable(e);
    Assert.assertEquals(throwable, npe);

    //we add the 101th exception then we lost the reference to NullPointerException
    e = new RemoteInvocationException(temp);
    throwable = LoadBalancerUtil.findOriginalThrowable(e);
    Assert.assertFalse(throwable instanceof NullPointerException);
  }
View Full Code Here

Examples of net.sourceforge.rmilite.RemoteInvocationException

        try {
            return handler.invoke(method.getName(), parameterTypes, args);
        } catch (RemoteInvocationException e) {
            rethrow(method, e);
        } catch (RemoteException e) {
            throw new RemoteInvocationException(method.getName(), e);
        }
        return null;
    }
View Full Code Here

Examples of net.sourceforge.rmilite.RemoteInvocationException

                returnValue = RemoteObject.toStub(remoteHandler);
            }

            return returnValue;
        } catch (InvocationTargetException e) {
            throw new RemoteInvocationException(methodName, e.getTargetException());
        } catch (Exception e) {
            throw new RemoteInvocationException(methodName, e);
        }
    }
View Full Code Here

Examples of org.exolab.jms.net.proxy.RemoteInvocationException

     * Throws a <code>RemoveInvocationException</code> when invoked.
     *
     * @throws RemoteInvocationException when invoked
     */
    public void throwUndeclaredRemoteInvocationException() {
        throw new RemoteInvocationException("ExceptionService");
    }
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.