// To check whether this is a local stub or not we must call
// org.omg.CORBA.portable.ObjectImpl._is_local(), and _not_
// javax.rmi.CORBA.Util.isLocal(Stub s), which in Sun's JDK
// always return false.
InputStream in = null;
try {
try {
OutputStream out =
(OutputStream) _request(operationName, true);
stubStrategy.writeParams(out, params);
trace("sent request: " + operationName);
in = (InputStream) _invoke(out);
if (stubStrategy.isNonVoid()) {
trace("received reply");
final InputStream finalIn = in;
return doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
return stubStrategy.readRetval(finalIn);
}
});
} else {
return null;
}
} catch (final ApplicationException ex) {
trace("got application exception");
in = (InputStream) ex.getInputStream();
final InputStream finalIn1 = in;
throw doPrivileged(new PrivilegedAction<Exception>() {
public Exception run() {
return stubStrategy.readException(ex.getId(), finalIn1);
}
});