FileDocCategorySizeDatePackage
_AccountImplBase.javaAPI DocExample3055Thu Nov 08 00:23:40 GMT 2001com.ora.rmibook.chapter23.corbaaccounts

_AccountImplBase

public abstract class _AccountImplBase extends org.omg.CORBA.portable.ObjectImpl implements Account, org.omg.CORBA.portable.InvokeHandler
_AccountImplBase.java Generated by the IDL-to-Java compiler (portable), version "3.0" from Account.idl Saturday, December 16, 2000 10:18:17 PM PST

Fields Summary
private static Hashtable
_methods
private static String[]
__ids
Constructors Summary
public _AccountImplBase()

    
Methods Summary
public java.lang.String[]_ids()


       
        return __ids;
    
public org.omg.CORBA.portable.OutputStream_invoke(java.lang.String method, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler rh)

     
        _methods.put("getBalance", new java.lang.Integer (0));
        _methods.put("makeDeposit", new java.lang.Integer (1));
        _methods.put("makeWithdrawal", new java.lang.Integer (2));
    
        org.omg.CORBA.portable.OutputStream out = null;
        java.lang.Integer __method = (java.lang.Integer) _methods.get(method);

        if (__method == null)
            throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);

        switch (__method.intValue()) {
        case 0:  // Account/getBalance
            {
                Money __result = null;

                __result = this.getBalance();
                out = rh.createReply();
                MoneyHelper.write(out, __result);
                break;
            }

        case 1:  // Account/makeDeposit
            {
                try {
                    Money amount = MoneyHelper.read(in);

                    this.makeDeposit(amount);
                    out = rh.createReply();
                } catch (NegativeAmountException __ex) {
                    out = rh.createExceptionReply();
                    NegativeAmountExceptionHelper.write(out, __ex);
                }
                break;
            }

        case 2:  // Account/makeWithdrawal
            {
                try {
                    Money amount = MoneyHelper.read(in);

                    this.makeWithdrawal(amount);
                    out = rh.createReply();
                } catch (NegativeAmountException __ex) {
                    out = rh.createExceptionReply();
                    NegativeAmountExceptionHelper.write(out, __ex);
                } catch (OverdraftException __ex) {
                    out = rh.createExceptionReply();
                    OverdraftExceptionHelper.write(out, __ex);
                }
                break;
            }

        default:
            throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
        }

        return out;