Example usage for com.google.gwt.user.server.rpc CacheableRPC encodeResponseForFailure

List of usage examples for com.google.gwt.user.server.rpc CacheableRPC encodeResponseForFailure

Introduction

In this page you can find the example usage for com.google.gwt.user.server.rpc CacheableRPC encodeResponseForFailure.

Prototype

public static String encodeResponseForFailure(Method serviceMethod, Throwable cause,
            SerializationPolicy serializationPolicy, int flags) throws SerializationException 

Source Link

Usage

From source file:sk.seges.acris.rpc.GWTRPCServiceExporter.java

License:Apache License

/**
 * Wrapper around RPC utility invocation
 * @param rpcRequest RPCRequest/*  w  w  w .  j a v a 2s  .co  m*/
 * @param cause Exception to handle
 * @param targetMethod Method which threw the exception
 * @param targetParameters Method arguments  
 * @return RPC payload
 * @throws Exception
 */
protected String encodeResponseForFailure(RPCRequest rpcRequest, Throwable cause, Method targetMethod,
        Object[] targetParameters) throws SerializationException {
    SerializationPolicy serializationPolicy = getSerializationPolicyProvider()
            .getSerializationPolicyForFailure(rpcRequest, service, targetMethod, targetParameters, cause);
    return CacheableRPC.encodeResponseForFailure(rpcRequest.getMethod(), cause, serializationPolicy,
            serializationFlags);
}