com.google.gwt.user.server.rpc.RPC.decodeRequest()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中com.google.gwt.user.server.rpc.RPC.decodeRequest方法的一些代码示例,展示了RPC.decodeRequest的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RPC.decodeRequest方法的具体详情如下:
包路径:com.google.gwt.user.server.rpc.RPC
类名称:RPC
方法名:decodeRequest

RPC.decodeRequest介绍

[英]Returns an RPCRequest that is built by decoding the contents of an encoded RPC request.

This method is equivalent to calling #decodeRequest(String,Class)with null for the type parameter.
[中]返回通过解码已编码RPC请求的内容而生成的RPCRequest。
此方法相当于使用null调用#decodeRequest(String,Class)作为类型参数。

代码示例

代码示例来源:origin: kaaproject/kaa

@Override
public String processCall(String payload) throws SerializationException {
 try {
  perThreadRequest.set(getThreadLocalRequest());
  Object handler = getBean(getThreadLocalRequest());
  RPCRequest rpcRequest = RPC.decodeRequest(payload, handler.getClass(), this);
  onAfterRequestDeserialized(rpcRequest);
  if (LOG.isDebugEnabled()) {
   LOG.debug("Invoking " + handler.getClass().getName()
     + "." + rpcRequest.getMethod().getName());
  }
  return RpcHelper
    .invokeAndEncodeResponse(
      handler,
      rpcRequest.getMethod(),
      rpcRequest.getParameters(),
      rpcRequest.getSerializationPolicy()
    );
 } catch (IncompatibleRemoteServiceException ex) {
  log("An IncompatibleRemoteServiceException was thrown while processing this call.", ex);
  return RPC.encodeResponseForFailure(null, ex);
 } catch (SerializationException ex) {
  LOG.error("An SerializationException was thrown while processing this call.", ex);
  throw ex;
 } finally {
  perThreadRequest.set(null);
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

return decodeRequest(encodedRequest, null);

代码示例来源:origin: com.google.gwt/gwt-servlet

return decodeRequest(encodedRequest, type, null);

代码示例来源:origin: com.google.gwt/gwt-servlet

rpcRequest = RPC.decodeRequest(payload, delegate.getClass(), this);
} catch (IncompatibleRemoteServiceException ex) {
 log(

代码示例来源:origin: net.wetheinter/gwt-user

return decodeRequest(encodedRequest, null);

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

return decodeRequest(encodedRequest, null);

代码示例来源:origin: net.wetheinter/gwt-user

return decodeRequest(encodedRequest, type, null);

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

return decodeRequest(encodedRequest, type, null);

代码示例来源:origin: net.officefloor.plugin/officeplugin_gwt

@Override
public synchronized RPCRequest getRpcRequest() {
  // Lazy load the RPC request
  if (this.request == null) {
    // Obtain the request
    HttpRequest request = this.getHttpRequest();
    // Obtain the payload
    StringBuilder payload = new StringBuilder();
    try {
      InputStream body = request.getEntity();
      for (int value = body.read(); value != -1; value = body
          .read()) {
        payload.append((char) value);
      }
    } catch (IOException ex) {
      // Flag failed to read request.
      // This should typically not occur.
      this.sendFailure(ex);
      return null; // not occurs as sendFailure propagates failure
    }
    // Decode the GWT request
    this.request = RPC.decodeRequest(payload.toString());
  }
  // Return the RPC request
  return this.request;
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

rpcRequest = RPC.decodeRequest(payload, delegate.getClass(), this);
} catch (IncompatibleRemoteServiceException ex) {
 log(

代码示例来源:origin: fr.putnami.pwt/pwt

@Override
  protected void processPost(HttpServletRequest request, HttpServletResponse response) throws Throwable {
    try {
      String requestPayload = this.readContent(request);
      RPCRequest rpcRequest = RPC.decodeRequest(requestPayload, this.getClass(), this);

      String responsePayload =
        RPC.invokeAndEncodeResponse(this, rpcRequest.getMethod(), rpcRequest.getParameters(),
          rpcRequest.getSerializationPolicy(), rpcRequest.getFlags());

      boolean gzipEncode =
        RPCServletUtils.acceptsGzipEncoding(request)
          && RPCServletUtils.exceedsUncompressedContentLengthLimit(responsePayload);

      RPCServletUtils.writeResponse(null, response, responsePayload, gzipEncode);
    } catch (Exception e) {
      this.logger.error("Request processing failed", e);
      throw Throwables.propagate(e);
    }
  }
}

代码示例来源:origin: net.wetheinter/gwt-user

rpcRequest = RPC.decodeRequest(payload, delegate.getClass(), this);
} catch (IncompatibleRemoteServiceException ex) {
 log(

代码示例来源:origin: Putnami/putnami-web-toolkit

@Override
  protected void processPost(HttpServletRequest request, HttpServletResponse response) throws Throwable {
    try {
      String requestPayload = this.readContent(request);
      RPCRequest rpcRequest = RPC.decodeRequest(requestPayload, this.getClass(), this);

      String responsePayload =
        RPC.invokeAndEncodeResponse(this, rpcRequest.getMethod(), rpcRequest.getParameters(),
          rpcRequest.getSerializationPolicy(), rpcRequest.getFlags());

      boolean gzipEncode =
        RPCServletUtils.acceptsGzipEncoding(request)
          && RPCServletUtils.exceedsUncompressedContentLengthLimit(responsePayload);

      RPCServletUtils.writeResponse(null, response, responsePayload, gzipEncode);
    } catch (Exception e) {
      this.logger.error("Request processing failed", e);
      throw Throwables.propagate(e);
    }
  }
}

代码示例来源:origin: Putnami/putnami-web-toolkit

@RequestMapping(value = "/commandService", method = RequestMethod.POST)
public void processPostRpc(HttpServletRequest request, HttpServletResponse response)
  throws Throwable {
  try {
    String requestPayload = RPCServletUtils.readContentAsGwtRpc(request);
    RPCRequest rpcRequest = RPC.decodeRequest(requestPayload, CommandService.class, this);
    String responsePayload =
      RPC.invokeAndEncodeResponse(commandService,
        rpcRequest.getMethod(), rpcRequest.getParameters(),
        rpcRequest.getSerializationPolicy(), rpcRequest.getFlags());
    boolean gzipEncode =
      RPCServletUtils.acceptsGzipEncoding(request)
        && RPCServletUtils.exceedsUncompressedContentLengthLimit(responsePayload);
    RPCServletUtils.writeResponse(null, response, responsePayload, gzipEncode);
  } catch (Exception e) {
    this.logger.error("Request processing failed", e);
    throw Throwables.propagate(e);
  }
}

代码示例来源:origin: org.appverse.web.framework.modules.backend.frontfacade.gwt/appverse-web-modules-backend-frontfacade-gwt

@Override
public String processCall(final String payload)
    throws SerializationException {
  try {
    Object presentationService = applicationContext.getBean(serviceName
        .get());
    if (!(presentationService instanceof RemoteService)) {
      throw new IllegalArgumentException(
          "Requested Spring Bean is not a GWT RemoteService Presentation Service: "
              + payload + " (" + presentationService + ")");
    }
    RPCRequest rpcRequest = RPC.decodeRequest(payload,
        presentationService.getClass(), this);
    if (presentationService instanceof AuthenticationServiceFacade
        && rpcRequest.getMethod().equals(
            AuthenticationServiceFacade.class
                .getMethod("getXSRFSessionToken"))) {
      return RPC.encodeResponseForSuccess(rpcRequest.getMethod(),
          SecurityHelper.createXSRFToken(getThreadLocalRequest()));
    }
    return RPC.invokeAndEncodeResponse(presentationService,
        rpcRequest.getMethod(), rpcRequest.getParameters(),
        rpcRequest.getSerializationPolicy(), rpcRequest.getFlags());
  } catch (Exception e) {
    GWTPresentationException pex = new GWTPresentationException(
        e.getMessage());
    return RPC.encodeResponseForFailure(null, pex);
  }
}

代码示例来源:origin: sk.seges.acris/acris-security-openid-core

@Override
public String processCall(String payload) throws SerializationException {
  try {
    RPCRequest req = RPC.decodeRequest(payload, null, this);
    RemoteService service = getServiceInstance(req.getMethod().getDeclaringClass());
    return RPC.invokeAndEncodeResponse(service, req.getMethod(), req.getParameters(),
        req.getSerializationPolicy(), req.getFlags());
  } catch (IncompatibleRemoteServiceException ex) {
    log("IncompatibleRemoteServiceException in the processCall(String) method.", ex);
    return RPC.encodeResponseForFailure(null, ex);
  }
}

代码示例来源:origin: com.vaadin.external.atmosphere/atmosphere-gwt-poll

RPCRequest rpcRequest = RPC.decodeRequest(payload, this.getClass(), this);
onAfterRequestDeserialized(rpcRequest);
return RPC.invokeAndEncodeResponse(this, rpcRequest.getMethod(),

代码示例来源:origin: sk.seges.acris/acris-server-components

checkPermutationStrongName();
RPCRequest rpcRequest = RPC.decodeRequest(payload, null, this);
onAfterRequestDeserialized(rpcRequest);
Method targetMethod = getMethodToInvoke(rpcRequest.getMethod());

代码示例来源:origin: net.sf.gwt-widget/gwt-sl

checkPermutationStrongName();
RPCRequest rpcRequest = RPC.decodeRequest(payload, null, this);
onAfterRequestDeserialized(rpcRequest);
Method targetMethod = getMethodToInvoke(rpcRequest.getMethod());

相关文章