infcollection.java

来自「移动Agent编程工具Naplet」· Java 代码 · 共 30 行

JAVA
30
字号
package serviceImpl;import java.rmi.Remote;import java.rmi.RemoteException;import java.net.*;import naplet.*;/** * Implementation of non-priviledged serivces, which are to be called  * by naplets directly. */public class InfCollection implements service.InfCollection {	private String msg;	public InfCollection() throws RemoteException{		try {			msg = "Greeting from " + InetAddress.getLocalHost().getHostName(); 		} catch (java.net.UnknownHostException e) {			System.out.println("Unable to get local host name"); 		}	}	public String getMsg() throws RemoteException {		return msg;	}}

⌨️ 快捷键说明

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