- Distributed Computing in Java 9
- Raja Malleswara Rao Pattamsetti
- 135字
- 2021-07-02 21:02:34
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;
}
推薦閱讀
- JavaScript全程指南
- 企業級Java EE架構設計精深實踐
- 微服務與事件驅動架構
- 零基礎學Scratch少兒編程:小學課本中的Scratch創意編程
- Windows系統管理與服務配置
- 認識編程:以Python語言講透編程的本質
- 你必須知道的204個Visual C++開發問題
- Learning Selenium Testing Tools(Third Edition)
- Reactive Android Programming
- Angular開發入門與實戰
- C++從入門到精通(第5版)
- 新一代SDN:VMware NSX 網絡原理與實踐
- Scala編程(第5版)
- C語言程序設計實踐
- PHP 8從入門到精通(視頻教學版)