*/
public String processCall(String payload) throws SerializationException
{
// Normal processing
//
RPCRequest rpcRequest = null;
try
{
// Decode request
//
rpcRequest = RPC.decodeRequest(payload, this.getClass(), this);
if (rpcRequest == null)
{
throw new NullPointerException("No rpc request");
}
// Invoke method
//
GileadRPCHelper.parseInputParameters(rpcRequest, _beanManager,
getThreadLocalRequest().getSession());
Object returnValue = rpcRequest.getMethod().invoke(this, rpcRequest.getParameters());
returnValue = GileadRPCHelper.parseReturnValue(returnValue, _beanManager);
// Encode response
//
return RPC.encodeResponseForSuccess(rpcRequest.getMethod(),
returnValue,
rpcRequest.getSerializationPolicy());
}
catch (IllegalArgumentException e)
{
SecurityException securityException = new SecurityException(
"Blocked attempt to invoke method " + rpcRequest.getMethod());
securityException.initCause(e);
throw securityException;
}
catch (IllegalAccessException e)
{
SecurityException securityException = new SecurityException(
"Blocked attempt to access inaccessible method "
+ rpcRequest.getMethod()
+ " on target " + this);
securityException.initCause(e);
throw securityException;
}
catch (InvocationTargetException e)
{
// Clone exception if needed
Exception exception = (Exception) GileadRPCHelper.parseReturnValue(e.getCause(), _beanManager);
return RPC.encodeResponseForFailure(rpcRequest.getMethod(),
exception,
rpcRequest.getSerializationPolicy());
}
catch (IncompatibleRemoteServiceException ex)
{
// Clone exception if needed
Exception exception = (Exception) GileadRPCHelper.parseReturnValue(ex, _beanManager);
return RPC.encodeResponseForFailure(null, exception, rpcRequest.getSerializationPolicy());
}
}