- 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;
}
推薦閱讀
- HornetQ Messaging Developer’s Guide
- Learning Real-time Processing with Spark Streaming
- Java 開發從入門到精通(第2版)
- PHP+MySQL網站開發技術項目式教程(第2版)
- 領域驅動設計:軟件核心復雜性應對之道(修訂版)
- JavaScript機器人編程指南
- JavaScript+jQuery網頁特效設計任務驅動教程
- 零基礎學C語言(第4版)
- 人人都能開發RPA機器人:UiPath從入門到實戰
- PHP動態網站開發實踐教程
- Instant Pygame for Python Game Development How-to
- Python 3.6從入門到精通(視頻教學版)
- Swift 2 Blueprints
- 面向對象分析與設計(第3版)
- Eclipse開發(學習筆記)