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

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

本文整理了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

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

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

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

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

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

相关文章