FileDocCategorySizeDatePackage
LockingAccountFactory_Impl.javaAPI DocExample873Thu Nov 08 00:23:10 GMT 2001com.ora.rmibook.chapter17.better.factory

LockingAccountFactory_Impl

public class LockingAccountFactory_Impl extends LockingFactory_Impl

Fields Summary
Constructors Summary
public LockingAccountFactory_Impl()

    
Methods Summary
protected java.rmi.Remote_getServer(java.lang.String serverName)

        try {
            Account returnValue = new Account_Impl(getRandomMoney(), serverName);

            returnValue.setFactory(this);
            return returnValue;
        } catch (Exception ignored) {/* Creation of a local object should never fail*/
        }
        return null;
    
private MoneygetRandomMoney()

        int cents = (int) (Math.random() * 100000);

        return new Money(cents);