-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServer.java
More file actions
24 lines (19 loc) · 778 Bytes
/
Copy pathServer.java
File metadata and controls
24 lines (19 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package Server;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
//Acts as a middle-man between seller and buyer clients.
public class Server {
public static void main(String[] args) {
try {
// Create an instance of RMIInterfaceImpl
AuctionServerImpl rmiImpl = new AuctionServerImpl();
// Start the RMI registry on port 1099 (default RMI registry port)
Registry registry = LocateRegistry.createRegistry(1099);
// Bind the RMI object to the registry with the name "AuctionSystemService"
registry.rebind("auction", rmiImpl);
System.out.println("Auction Server is up");
} catch (Exception e) {
e.printStackTrace();
}
}
}