String message = "CORBA " + corbaName + " " + ex.minor + " " + status;
// Now map to the correct RemoteException type...
if (ex instanceof COMM_FAILURE) {
return new MarshalException(message, ex);
} else if (ex instanceof INV_OBJREF) {
RemoteException newEx = new NoSuchObjectException(message);
newEx.detail = ex;
return newEx;
} else if (ex instanceof NO_PERMISSION) {
return new AccessException(message, ex);
} else if (ex instanceof MARSHAL) {
return new MarshalException(message, ex);
} else if (ex instanceof OBJECT_NOT_EXIST) {
RemoteException newEx = new NoSuchObjectException(message);
newEx.detail = ex;
return newEx;
} else if (ex instanceof TRANSACTION_REQUIRED) {
RemoteException newEx = new TransactionRequiredException(message);
newEx.detail = ex;
return newEx;
} else if (ex instanceof TRANSACTION_ROLLEDBACK) {
RemoteException newEx = new TransactionRolledbackException(message);
newEx.detail = ex;
return newEx;
} else if (ex instanceof INVALID_TRANSACTION) {
RemoteException newEx = new InvalidTransactionException(message);
newEx.detail = ex;
return newEx;
} else if (ex instanceof BAD_PARAM) {
Exception inner = ex;
// Pre-Merlin Sun ORBs used the incorrect minor code for
// this case. See Java to IDL ptc-00-01-08 1.4.8.
if (ex.minor == ORBConstants.LEGACY_SUN_NOT_SERIALIZABLE ||
ex.minor == OMGSystemException.NOT_SERIALIZABLE) {
if (ex.getMessage() != null)
inner = new NotSerializableException(ex.getMessage());
else
inner = new NotSerializableException();
inner.initCause( ex ) ;
}
return new MarshalException(message,inner);
} else if (ex instanceof ACTIVITY_REQUIRED) {
try {
Class<?> cl = SharedSecrets.getJavaCorbaAccess().loadClass(
"javax.activity.ActivityRequiredException");
Class[] params = new Class[2];