/** This method is for local calls when using pass-by-value*/
protected Object invokeLocalMarshalled(Invocation invocation) throws Exception
{
IMarshalledValue value = createMarshalledValueForCallByValue(invocation.getArguments());
MarshalledInvocation invocationCopy = createInvocationCopy(invocation, value);
// copy the Tx
Transaction tx = invocation.getTransaction();
invocationCopy.setTransaction(tx);
try
{
Object rtnValue = localInvoker.invoke(invocationCopy);
IMarshalledValue mv = createMarshalledValueForCallByValue(rtnValue);
return mv.get();
}
catch(Throwable t)
{
IMarshalledValue mv = SerializationStreamFactory.getManagerInstance().createdMarshalledValue(t);
Throwable t2 = (Throwable) mv.get();
if( t2 instanceof Exception )
throw (Exception) t2;
else
throw new UndeclaredThrowableException(t2);
}