⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lockingaccountfactory_impl.java

📁 RMI英文教程,从各个方面教你怎么进行RMI开发
💻 JAVA
字号:
package com.ora.rmibook.chapter17.better.factory;


import com.ora.rmibook.chapter17.better.valueobjects.*;
import com.ora.rmibook.chapter17.better.*;
import java.rmi.server.*;
import java.rmi.*;
import java.util.*;


public class LockingAccountFactory_Impl extends LockingFactory_Impl {
    public LockingAccountFactory_Impl()  throws RemoteException {
    }

    protected Remote _getServer(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 Money getRandomMoney() {
        int cents = (int) (Math.random() * 100000);

        return new Money(cents);
    }
} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -