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

📄 myrmiimpl.java

📁 Long-distance rmi transfers java to realize may realize a service end many client side conversation
💻 JAVA
字号:
package com.antbang.rmilab;/* * To change this template, choose Tools | Templates * and open the template in the editor. *//** * * @author GAGA */import java.rmi.*;import java.rmi.server.UnicastRemoteObject;import java.util.Date;import java.util.Properties;public class MyRMIImpl extends UnicastRemoteObject implements MyRMIInterface{    public MyRMIImpl(String name) throws RemoteException    {        super();        try        {            Naming.rebind(name, this);        } catch (Exception e)        {            System.out.println("Exception occurred: " + e);        }    }    public Date getDate()    {        return new java.util.Date();    }    public String getDiscription()    {        StringBuilder hostDescription = new StringBuilder();        Properties properties=System.getProperties();        for (Object key : properties.keySet())        {            if(properties.get(key).toString().length()>30)                continue;            hostDescription.append(key+""+" : ");            hostDescription.append(properties.get(key)+"\n");        }        return hostDescription.toString();    }    public void sendMessage(Message message) throws RemoteException    {        System.out.println(message);    }}

⌨️ 快捷键说明

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