📄 rmiserver.java
字号:
/* * RMIServer.java * * Created on 2006年9月14日, 下午2:05 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package simplermi;import java.rmi.*;import java.rmi.registry.LocateRegistry;/** * 服务端程序 * @author jiang * @version 1.0 */public class RMIServer{ public static void main(String[] args) { try { //先创建远程对象的实例 MyRemoteInterface remote1=new MyRemoteImpl(); //为客户端创建注册表 不指定端口号码则默认为1099 LocateRegistry.createRegistry(2200); //将对象实例绑定独一无二的名称注册到注册表 要想实现本机测试需提供主机名称"lili" Naming.rebind("//flzhu:2200/Manager",remote1); System.out.println("Waiting for invocations from Client"); } catch(Exception e) { e.printStackTrace(); } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -