Object[] args = dmm.readArguments( in ) ;
Object result = javaMethod.invoke( target, args ) ;
OutputStream os = (OutputStream)reply.createReply() ;
dmm.writeResult( os, result ) ;
return os ;
} catch (IllegalAccessException ex) {
throw wrapper.invocationErrorInReflectiveTie( ex,
javaMethod.getName(),
javaMethod.getDeclaringClass().getName() ) ;
} catch (IllegalArgumentException ex) {
throw wrapper.invocationErrorInReflectiveTie( ex,
javaMethod.getName(),
javaMethod.getDeclaringClass().getName() ) ;
} catch (InvocationTargetException ex) {
// Unwrap the actual exception so that it can be wrapped by an
// UnknownException or thrown if it is a system exception.
// This is expected in the server dispatcher code.
Throwable thr = ex.getCause() ;
if (thr instanceof SystemException)
throw (SystemException)thr ;
else if ((thr instanceof Exception) &&
dmm.isDeclaredException( thr )) {
OutputStream os = (OutputStream)reply.createExceptionReply() ;
dmm.writeException( os, (Exception)thr ) ;
return os ;
} else
throw new UnknownException( thr ) ;
}