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

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

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

RPC.getDefaultSerializationPolicy介绍

[英]Returns a default serialization policy.
[中]返回默认的序列化策略。

代码示例

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

/**
 * Returns a string that encodes the object. It is an error to try to encode
 * an object that is not assignable to the service method's return type.
 * 
 * @param serviceMethod the method whose result we are encoding
 * @param object the instance that we wish to encode
 * @return a string that encodes the object, if the object is compatible with
 *         the service method's declared return type
 * 
 * @throws IllegalArgumentException if the result is not assignable to the
 *           service method's return type
 * @throws NullPointerException if the service method is <code>null</code>
 * @throws SerializationException if the result cannot be serialized
 */
public static String encodeResponseForSuccess(Method serviceMethod, Object object)
  throws SerializationException {
 return encodeResponseForSuccess(serviceMethod, object, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes an exception. If method is not
 * <code>null</code>, it is an error if the exception is not in the method's
 * list of checked exceptions.
 * 
 * @param serviceMethod the method that threw the exception, may be
 *          <code>null</code>
 * @param cause the {@link Throwable} that was thrown
 * @return a string that encodes the exception
 * 
 * @throws NullPointerException if the cause is <code>null</code>
 * @throws SerializationException if the result cannot be serialized
 * @throws UnexpectedException if the result was an unexpected exception (a
 *           checked exception not declared in the serviceMethod's signature)
 */
public static String encodeResponseForFailure(Method serviceMethod, Throwable cause)
  throws SerializationException {
 return encodeResponseForFailure(serviceMethod, cause, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes the result of calling a service method, which
 * could be the value returned by the method or an exception thrown by it.
 * 
 * <p>
 * This method does no security checking; security checking must be done on
 * the method prior to this invocation.
 * </p>
 * 
 * @param target instance on which to invoke the serviceMethod
 * @param serviceMethod the method to invoke
 * @param args arguments used for the method invocation
 * @return a string which encodes either the method's return or a checked
 *         exception thrown by the method
 * 
 * @throws SecurityException if the method cannot be accessed or if the number
 *           or type of actual and formal arguments differ
 * @throws SerializationException if an object could not be serialized by the
 *           stream
 * @throws UnexpectedException if the serviceMethod throws a checked exception
 *           that is not declared in its signature
 */
public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args)
  throws SerializationException {
 return invokeAndEncodeResponse(target, serviceMethod, args, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes an exception. If <code>rpcRequest</code>
 * is <code>null</code> a default serialization policy and default request
 * flags will be used. Otherwise these information are taken from
 * <code>rpcRequest</code>.
 * <p>
 * This method should be used if the RPC request could not be decoded or
 * could not be executed because of an exception thrown, e.g.
 * {@link IncompatibleRemoteServiceException}, {@link RpcTokenException}
 * </p>
 * @param rpcRequest the RPCRequest that failed to execute, may be null
 * @param cause the {@link Throwable} that was thrown
 * @return a String that encodes the exception
 * @throws SerializationException if the result cannot be serialized
 */
public static String encodeResponseForFailedRequest(RPCRequest rpcRequest, Throwable cause)
  throws SerializationException {
 if (rpcRequest == null) {
  return RPC.encodeResponseForFailure(null, cause,
    getDefaultSerializationPolicy(), AbstractSerializationStream.DEFAULT_FLAGS);
 } else {
  return RPC.encodeResponseForFailure(null, cause,
    rpcRequest.getSerializationPolicy(), rpcRequest.getFlags());
 }
}

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

+ moduleBaseURL
    + "'; a legacy, 1.3.3 compatible, serialization policy will be used.  You may experience SerializationExceptions as a result.");
serializationPolicy = RPC.getDefaultSerializationPolicy();

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

/**
 * Returns a string that encodes the object. It is an error to try to encode
 * an object that is not assignable to the service method's return type.
 * 
 * @param serviceMethod the method whose result we are encoding
 * @param object the instance that we wish to encode
 * @return a string that encodes the object, if the object is compatible with
 *         the service method's declared return type
 * 
 * @throws IllegalArgumentException if the result is not assignable to the
 *           service method's return type
 * @throws NullPointerException if the service method is <code>null</code>
 * @throws SerializationException if the result cannot be serialized
 */
public static String encodeResponseForSuccess(Method serviceMethod, Object object)
  throws SerializationException {
 return encodeResponseForSuccess(serviceMethod, object, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes an exception. If method is not
 * <code>null</code>, it is an error if the exception is not in the method's
 * list of checked exceptions.
 * 
 * @param serviceMethod the method that threw the exception, may be
 *          <code>null</code>
 * @param cause the {@link Throwable} that was thrown
 * @return a string that encodes the exception
 * 
 * @throws NullPointerException if the cause is <code>null</code>
 * @throws SerializationException if the result cannot be serialized
 * @throws UnexpectedException if the result was an unexpected exception (a
 *           checked exception not declared in the serviceMethod's signature)
 */
public static String encodeResponseForFailure(Method serviceMethod, Throwable cause)
  throws SerializationException {
 return encodeResponseForFailure(serviceMethod, cause, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes the object. It is an error to try to encode
 * an object that is not assignable to the service method's return type.
 * 
 * @param serviceMethod the method whose result we are encoding
 * @param object the instance that we wish to encode
 * @return a string that encodes the object, if the object is compatible with
 *         the service method's declared return type
 * 
 * @throws IllegalArgumentException if the result is not assignable to the
 *           service method's return type
 * @throws NullPointerException if the service method is <code>null</code>
 * @throws SerializationException if the result cannot be serialized
 */
public static String encodeResponseForSuccess(Method serviceMethod, Object object)
  throws SerializationException {
 return encodeResponseForSuccess(serviceMethod, object, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes an exception. If method is not
 * <code>null</code>, it is an error if the exception is not in the method's
 * list of checked exceptions.
 * 
 * @param serviceMethod the method that threw the exception, may be
 *          <code>null</code>
 * @param cause the {@link Throwable} that was thrown
 * @return a string that encodes the exception
 * 
 * @throws NullPointerException if the cause is <code>null</code>
 * @throws SerializationException if the result cannot be serialized
 * @throws UnexpectedException if the result was an unexpected exception (a
 *           checked exception not declared in the serviceMethod's signature)
 */
public static String encodeResponseForFailure(Method serviceMethod, Throwable cause)
  throws SerializationException {
 return encodeResponseForFailure(serviceMethod, cause, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes the result of calling a service method, which
 * could be the value returned by the method or an exception thrown by it.
 * 
 * <p>
 * This method does no security checking; security checking must be done on
 * the method prior to this invocation.
 * </p>
 * 
 * @param target instance on which to invoke the serviceMethod
 * @param serviceMethod the method to invoke
 * @param args arguments used for the method invocation
 * @return a string which encodes either the method's return or a checked
 *         exception thrown by the method
 * 
 * @throws SecurityException if the method cannot be accessed or if the number
 *           or type of actual and formal arguments differ
 * @throws SerializationException if an object could not be serialized by the
 *           stream
 * @throws UnexpectedException if the serviceMethod throws a checked exception
 *           that is not declared in its signature
 */
public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args)
  throws SerializationException {
 return invokeAndEncodeResponse(target, serviceMethod, args, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes the result of calling a service method, which
 * could be the value returned by the method or an exception thrown by it.
 * 
 * <p>
 * This method does no security checking; security checking must be done on
 * the method prior to this invocation.
 * </p>
 * 
 * @param target instance on which to invoke the serviceMethod
 * @param serviceMethod the method to invoke
 * @param args arguments used for the method invocation
 * @return a string which encodes either the method's return or a checked
 *         exception thrown by the method
 * 
 * @throws SecurityException if the method cannot be accessed or if the number
 *           or type of actual and formal arguments differ
 * @throws SerializationException if an object could not be serialized by the
 *           stream
 * @throws UnexpectedException if the serviceMethod throws a checked exception
 *           that is not declared in its signature
 */
public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args)
  throws SerializationException {
 return invokeAndEncodeResponse(target, serviceMethod, args, getDefaultSerializationPolicy());
}

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

/**
 * Returns a string that encodes an exception. If <code>rpcRequest</code>
 * is <code>null</code> a default serialization policy and default request
 * flags will be used. Otherwise these information are taken from
 * <code>rpcRequest</code>.
 * <p>
 * This method should be used if the RPC request could not be decoded or
 * could not be executed because of an exception thrown, e.g.
 * {@link IncompatibleRemoteServiceException}, {@link RpcTokenException}
 * </p>
 * @param rpcRequest the RPCRequest that failed to execute, may be null
 * @param cause the {@link Throwable} that was thrown
 * @return a String that encodes the exception
 * @throws SerializationException if the result cannot be serialized
 */
public static String encodeResponseForFailedRequest(RPCRequest rpcRequest, Throwable cause)
  throws SerializationException {
 if (rpcRequest == null) {
  return RPC.encodeResponseForFailure(null, cause,
    getDefaultSerializationPolicy(), AbstractSerializationStream.DEFAULT_FLAGS);
 } else {
  return RPC.encodeResponseForFailure(null, cause,
    rpcRequest.getSerializationPolicy(), rpcRequest.getFlags());
 }
}

代码示例来源:origin: org.jboss.seam/jboss-seam-remoting

public final SerializationPolicy getSerializationPolicy(
   String moduleBaseURL, String strongName)
{
 SerializationPolicy serializationPolicy = getCachedSerializationPolicy(
    moduleBaseURL, strongName);
 if (serializationPolicy != null)
 {
   return serializationPolicy;
 }
 serializationPolicy = doGetSerializationPolicy(getThreadLocalRequest(),
    moduleBaseURL, strongName);
 if (serializationPolicy == null)
 {
   // Failed to get the requested serialization policy; use the default
   getServletContext()
      .log(
         "WARNING: Failed to get the SerializationPolicy '"
            + strongName
            + "' for module '"
            + moduleBaseURL
            + "'; a legacy, 1.3.3 compatible, serialization policy will be used.  You may experience SerializationExceptions as a result.");
   serializationPolicy = RPC.getDefaultSerializationPolicy();
 }
 // This could cache null or an actual instance. Either way we will not
 // attempt to lookup the policy again.
 putCachedSerializationPolicy(moduleBaseURL, strongName,
    serializationPolicy);
 return serializationPolicy;
}

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

/**
 * Returns a string that encodes an exception. If <code>rpcRequest</code>
 * is <code>null</code> a default serialization policy and default request
 * flags will be used. Otherwise these information are taken from
 * <code>rpcRequest</code>.
 * <p>
 * This method should be used if the RPC request could not be decoded or
 * could not be executed because of an exception thrown, e.g.
 * {@link IncompatibleRemoteServiceException}, {@link RpcTokenException}
 * </p>
 * @param rpcRequest the RPCRequest that failed to execute, may be null
 * @param cause the {@link Throwable} that was thrown
 * @return a String that encodes the exception
 * @throws SerializationException if the result cannot be serialized
 */
public static String encodeResponseForFailedRequest(RPCRequest rpcRequest, Throwable cause)
  throws SerializationException {
 if (rpcRequest == null) {
  return RPC.encodeResponseForFailure(null, cause,
    getDefaultSerializationPolicy(), AbstractSerializationStream.DEFAULT_FLAGS);
 } else {
  return RPC.encodeResponseForFailure(null, cause,
    rpcRequest.getSerializationPolicy(), rpcRequest.getFlags());
 }
}

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

public final SerializationPolicy getSerializationPolicy(String moduleBaseURL,
                            String strongName) {
  SerializationPolicy serializationPolicy = getCachedSerializationPolicy(
      moduleBaseURL, strongName);
  if (serializationPolicy != null) {
    return serializationPolicy;
  }
  serializationPolicy = doGetSerializationPolicy(getThreadLocalRequest(),
      moduleBaseURL, strongName);
  if (serializationPolicy == null) {
    // Failed to get the requested serialization policy; use the default
    log(
        "WARNING: Failed to get the SerializationPolicy '"
            + strongName
            + "' for module '"
            + moduleBaseURL
            + "'; a legacy, 1.3.3 compatible, serialization policy will be used.  You may experience SerializationExceptions as a result.",
        null);
    serializationPolicy = RPC.getDefaultSerializationPolicy();
  }
  // This could cache null or an actual instance. Either way we will not
  // attempt to lookup the policy again.
  putCachedSerializationPolicy(moduleBaseURL, strongName, serializationPolicy);
  return serializationPolicy;
}

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

+ moduleBaseURL
    + "'; a legacy, 1.3.3 compatible, serialization policy will be used.  You may experience SerializationExceptions as a result.");
serializationPolicy = RPC.getDefaultSerializationPolicy();

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

+ moduleBaseURL
    + "'; a legacy, 1.3.3 compatible, serialization policy will be used.  You may experience SerializationExceptions as a result.");
serializationPolicy = RPC.getDefaultSerializationPolicy();

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

} else {
  serializationPolicy = RPC.getDefaultSerializationPolicy();
  flags = 0;

相关文章