currentThread.setContextClassLoader(classloader);
marshalledInvocation = (Invocation) mo.get();
} catch (Throwable e) {
// Could not deserialize the invocation...
mo.set(new ThrowableWrapper(e));
return new SimpleInvocationResult(false, mo);
}
try {
InvocationResult rc = next.invoke(marshalledInvocation);
mo.set(new SimpleInvocationResult(rc.isNormal(), rc.getResult()));
return new SimpleInvocationResult(true, mo);
} catch (Throwable e) {
mo.set(new ThrowableWrapper(e));
return new SimpleInvocationResult(true, mo);
}
} finally {
currentThread.setContextClassLoader(orig);
}