Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dk.sdu.mmmi.opn.assignment2;
- import java.rmi.registry.LocateRegistry;
- import java.rmi.registry.Registry;
- public class Server {
- //the name assigned to the server object.
- public static final String NAME = "OPN-server(RMI)";
- //the part on which the registry is run
- public static final int PORT = 5555;
- public static void main(String[] args) {
- System.out.println("Launching server");
- try{
- CatalogueImpl cataImpl = new CatalogueImpl();
- Registry registry = LocateRegistry.createRegistry(Server.PORT);
- registry.rebind(Server.NAME, cataImpl);
- System.out.println("Server running (RMI)");
- } catch (Exception e){
- System.err.println("Server exception");
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement