cityfactoryimpl.java

来自「《JAVA分布式程序设计》一书的源代码。」· Java 代码 · 共 32 行

JAVA
32
字号
import java.rmi.*;import java.rmi.server.UnicastRemoteObject;/** * @(#)CityFactoryImpl.java * @author Qusay H. Mahmoud */public class CityFactoryImpl extends UnicastRemoteObject implements CityFactory {   public CityFactoryImpl() throws RemoteException {      super();   }   public City2Impl getCityServer(String cityName) throws RemoteException {      City2Impl cityServer = new City2Impl(cityName);      return cityServer;   }   public static void main(String argv[]) {      System.setSecurityManager(new RMISecurityManager());      try {        CityFactoryImpl obj = new CityFactoryImpl();        Naming.rebind("//localhost/CityFactory", obj);        System.out.println("CityFactory bound in registry");      } catch (Exception e) {        e.printStackTrace();      }   }}

⌨️ 快捷键说明

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