-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrontEnd.java
More file actions
38 lines (29 loc) · 1 KB
/
FrontEnd.java
File metadata and controls
38 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package AuctioningSystem;
/*
Code: auction server AuctionServer.java
Server code for hosting the auctionImpl object
*/
import java.rmi.Naming; //Import naming classes to bind to rmiregistry
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class FrontEnd {
//auctionserver constructor
public FrontEnd() {
//Construct a new auctionImpl object and bind it to the local rmiregistry
//N.b. it is possible to host multiple objects on a server by repeating the
//following method.
try {
FrontEndImpl f = new FrontEndImpl();
LocateRegistry.createRegistry(1099); //creates rmi registry
Naming.bind("rmi://localhost/FrontEnd", f); //binds frontend remote object to rmi server
}
catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String args[]) {
//Create the new auction server
new FrontEnd();
System.out.println("Front end server is running");
}
}