Examples of RpcRequest


Examples of com.google.gwt.user.server.rpc.RPCRequest

    assert clientOracle != null : "clientOracle";
    assert payload != null : "payload";
    assert stream != null : "stream";

    try {
      RPCRequest rpcRequest = RPC.decodeRequest(payload, this.getClass(),
          clientOracle);
      onAfterRequestDeserialized(rpcRequest);
      RPC.invokeAndStreamResponse(this, rpcRequest.getMethod(),
          rpcRequest.getParameters(), clientOracle, stream);
    } catch (RemoteException ex) {
      throw new SerializationException("An exception was sent from the client",
          ex.getCause());
    } catch (IncompatibleRemoteServiceException ex) {
      log(
View Full Code Here

Examples of com.google.gwt.user.server.rpc.RPCRequest

          Object o = CommandSerializationUtil.getAccessor(parameterTypes[i]).readNext(
              streamReader);
          parameterValues[i] = o;
        }

        return new RPCRequest(method, parameterValues, null, 0);

      } catch (NoSuchMethodException e) {
        throw new IncompatibleRemoteServiceException(
            formatMethodNotFoundErrorMessage(serviceIntf, serviceMethodName,
                parameterTypes));
View Full Code Here

Examples of com.google.gwt.user.server.rpc.RPCRequest

      if (delegate == null) {
        throw new AssertionError("RPC实例为null");
      }
      String payload = RPCServletUtils.readContent(request,
          "text/x-gwt-rpc", null);
      RPCRequest rpcRequest = RPC.decodeRequest(payload,
          delegate.getClass(), this);
      Method rpcRequestMethod = rpcRequest.getMethod();
      try {
        String responsePayload = RPC4Monitor.invokeAndEncodeResponse(delegate,
            rpcRequestMethod, rpcRequest.getParameters(),
            rpcRequest.getSerializationPolicy(),
            rpcRequest.getFlags());
        RPCServletUtils.writeResponse(null, (HttpServletResponse) resp,
            responsePayload, false);
      } catch (SerializationException e) {
        log.error(e);
        throw new RuntimeException("RPC序列化异常", e);
View Full Code Here

Examples of com.google.gwt.user.server.rpc.RPCRequest

                for (int i = 0; i < parameterValues.length; i++) {
                    parameterValues[i] = streamReader.deserializeValue(parameterTypes[i]);
                }

                return new RPCRequest(method, parameterValues,
                    serializationPolicy);
            } catch (NoSuchMethodException e) {
                throw new IncompatibleRemoteServiceException(formatMethodNotFoundErrorMessage(
                        type, serviceMethodName, parameterTypes));
            }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.RPCRequest

    }

    @Override
    public String processCall(String payload) throws SerializationException {
        try {
            RPCRequest rpcRequest = StreamServiceUtils.decodeRequest(payload,
                    this.getClass(), this);
            //onAfterRequestDeserialized(rpcRequest);

            StreamServiceIterator iterator = null;

            try {
                iterator = (StreamServiceIterator) rpcRequest.getMethod()
                                                             .invoke(this,
                        rpcRequest.getParameters());

                try {
                    this.sendResults(rpcRequest.getMethod(), iterator,
                        rpcRequest.getSerializationPolicy());
                } catch (Exception e) {
                    throw new RuntimeException(e);
                } finally {
                    if (iterator != null) {
                        iterator.close();
View Full Code Here

Examples of com.google.gwt.user.server.rpc.RPCRequest

        log.error( e.getMessage(), e );
        throw e;
      }
    }
    else {
      RPCRequest rpcRequest = RPC.decodeRequest( payload, this.getClass(), this );
      return RPC.encodeResponseForFailure( rpcRequest.getMethod(), new GWTInvalidSessionException() );
    }
  }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.RPCRequest

   */
  public String processCall(String payload) throws SerializationException
  {   
  //  Normal processing
  //
    RPCRequest rpcRequest = null;
    try
    {
    // Decode request
    //
         rpcRequest = RPCCopy.getInstance().decodeRequest(payload, this.getClass(), this);
       
      //  Invoke method
      //
         HibernateRPCHelper.parseInputParameters(rpcRequest, _beanManager,
                                getThreadLocalRequest().getSession());
         Object returnValue = RPCCopy.getInstance().invoke(this, rpcRequest.getMethod(),
                             rpcRequest.getParameters(),
                             rpcRequest.getSerializationPolicy());
       
         returnValue = HibernateRPCHelper.parseReturnValue(returnValue, _beanManager);
       
      //  Encode response
      // 
        return RPCCopy.getInstance().encodeResponseForSuccess(rpcRequest.getMethod(),
                                      returnValue,
                                      rpcRequest.getSerializationPolicy());
       
      }
    catch (InvocationTargetException e)
    {
      return RPCCopy.getInstance().encodeResponseForFailure(rpcRequest.getMethod(), e.getCause());
    }
    catch (IncompatibleRemoteServiceException ex)
    {
          return RPCCopy.getInstance().encodeResponseForFailure(null, ex);
      }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.RPCRequest

        log.error( e.getMessage(), e );
        throw e;
      }
    }
    else {
      RPCRequest rpcRequest = RPC.decodeRequest( payload, this.getClass(), this );
      return RPC.encodeResponseForFailure( rpcRequest.getMethod(), new GWTInvalidSessionException() );
    }
  }
View Full Code Here

Examples of com.google.gwt.user.server.rpc.RPCRequest

    assert clientOracle != null : "clientOracle";
    assert payload != null : "payload";
    assert stream != null : "stream";

    try {
      RPCRequest rpcRequest = RPC.decodeRequest(payload, this.getClass(),
          clientOracle);
      onAfterRequestDeserialized(rpcRequest);
      RPC.invokeAndStreamResponse(this, rpcRequest.getMethod(),
          rpcRequest.getParameters(), clientOracle, stream);
    } catch (RemoteException ex) {
      throw new SerializationException("An exception was sent from the client",
          ex.getCause());
    } catch (IncompatibleRemoteServiceException ex) {
      log(
View Full Code Here

Examples of com.linkedin.r2.message.rpc.RpcRequest

  @Override
  @Deprecated
  @SuppressWarnings("deprecation")
  public void echo(String msg, final Callback<String> callback)
  {
    final RpcRequest request = new RpcRequestBuilder(_uri)
            .setEntity(ByteString.copyString(msg, RpcEchoServer.CHARSET))
            .build();

    _client.rpcRequest(request, new CallbackAdapter<String, RpcResponse>(callback)
    {
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.