官术网_书友最值得收藏!

Writing an RMI server

Suppose we are building an application to perform diverse mathematical operations. Let's design a project that can sit on a server. Post this, have different client projects interact with this project to pass the parameters and get the computation on the remote object execute and return the result to the client components. This needs the remote interface to be defined first, as discussed in the preceding section.

The following is the definition of the Calculate interface that extends the Remote interface:

package remote;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Calculate extends Remote {
public long add(long parameterOne, long parameterTwo)
throws RemoteException;
public long sub(long parameterOne, long parameterTwo)
throws RemoteException;
public long mul(long parameterOne, long parameterTwo)
throws RemoteException;
public long div(long parameterOne, long parameterTwo)
throws RemoteException;
}
主站蜘蛛池模板: 团风县| 沽源县| 开鲁县| 乐山市| 木兰县| 高台县| 依安县| 彭阳县| 苏尼特右旗| 左贡县| 东光县| 介休市| 辽宁省| 富锦市| 通河县| 巴里| 新巴尔虎右旗| 柳州市| 巴中市| 巴南区| 永寿县| 长顺县| 阿城市| 色达县| 竹山县| 金坛市| 蓬溪县| 会昌县| 长泰县| 收藏| 板桥市| 黑水县| 苍山县| 科技| 南江县| 望都县| 怀化市| 汉源县| 比如县| 天气| 洮南市|