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

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

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

RPC.getRpcVersion介绍

暂无

代码示例

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

  1. /**
  2. * Returns a string that encodes the results of an RPC call. Private overload
  3. * that takes a flag signaling the preamble of the response payload.
  4. *
  5. * @param object the object that we wish to send back to the client
  6. * @param wasThrown if true, the object being returned was an exception thrown
  7. * by the service method; if false, it was the result of the service
  8. * method's invocation
  9. * @return a string that encodes the response from a service method
  10. * @throws SerializationException if the object cannot be serialized
  11. */
  12. private static String encodeResponse(Class<?> responseClass, Object object, boolean wasThrown,
  13. int flags, SerializationPolicy serializationPolicy) throws SerializationException {
  14. ServerSerializationStreamWriter stream =
  15. new ServerSerializationStreamWriter(serializationPolicy, getRpcVersion());
  16. stream.setFlags(flags);
  17. stream.prepareToWrite();
  18. if (responseClass != void.class) {
  19. stream.serializeValue(object, responseClass);
  20. }
  21. String bufferStr = (wasThrown ? "//EX" : "//OK") + stream.toString();
  22. return bufferStr;
  23. }

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

  1. /**
  2. * Returns a string that encodes the results of an RPC call. Private overload
  3. * that takes a flag signaling the preamble of the response payload.
  4. *
  5. * @param object the object that we wish to send back to the client
  6. * @param wasThrown if true, the object being returned was an exception thrown
  7. * by the service method; if false, it was the result of the service
  8. * method's invocation
  9. * @return a string that encodes the response from a service method
  10. * @throws SerializationException if the object cannot be serialized
  11. */
  12. private static String encodeResponse(Class<?> responseClass, Object object, boolean wasThrown,
  13. int flags, SerializationPolicy serializationPolicy) throws SerializationException {
  14. ServerSerializationStreamWriter stream =
  15. new ServerSerializationStreamWriter(serializationPolicy, getRpcVersion());
  16. stream.setFlags(flags);
  17. stream.prepareToWrite();
  18. if (responseClass != void.class) {
  19. stream.serializeValue(object, responseClass);
  20. }
  21. String bufferStr = (wasThrown ? "//EX" : "//OK") + stream.toString();
  22. return bufferStr;
  23. }

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

  1. /**
  2. * Returns a string that encodes the results of an RPC call. Private overload
  3. * that takes a flag signaling the preamble of the response payload.
  4. *
  5. * @param object the object that we wish to send back to the client
  6. * @param wasThrown if true, the object being returned was an exception thrown
  7. * by the service method; if false, it was the result of the service
  8. * method's invocation
  9. * @return a string that encodes the response from a service method
  10. * @throws SerializationException if the object cannot be serialized
  11. */
  12. private static String encodeResponse(Class<?> responseClass, Object object, boolean wasThrown,
  13. int flags, SerializationPolicy serializationPolicy) throws SerializationException {
  14. ServerSerializationStreamWriter stream =
  15. new ServerSerializationStreamWriter(serializationPolicy, getRpcVersion());
  16. stream.setFlags(flags);
  17. stream.prepareToWrite();
  18. if (responseClass != void.class) {
  19. stream.serializeValue(object, responseClass);
  20. }
  21. String bufferStr = (wasThrown ? "//EX" : "//OK") + stream.toString();
  22. return bufferStr;
  23. }

相关文章