New owners now can be created properly.
[RRRRHHHH_Code] / ruralHouses / src / launcher / RMILauncher.java
index f5a4cf8..167f1e0 100644 (file)
@@ -4,6 +4,7 @@ import java.rmi.Naming;
 import java.rmi.RMISecurityManager;
 import java.rmi.Remote;
 
+import businessLogic.AccountManager;
 import businessLogic.AdminManager;
 import businessLogic.BookingManager;
 import businessLogic.HouseManager;
@@ -37,13 +38,15 @@ public class RMILauncher {
                boolean off = runOffer();
                boolean own = runOwner();
                boolean log = runLogin();
+               boolean acc = runAccount();
 
                System.out.println("  Admin: "+adm+
                                                        "\t Booking:  "+bok+
                                                        "\t House:  "+hou+
                                                        "\t Login:  "+log+
                                                        "\t Offer:  "+off+
-                                                       "\t Owner:  "+own);
+                                                       "\t Owner:  "+own+
+                                                       "\t Account: "+acc);
        }
        
        private static boolean runAdmin() {
@@ -58,6 +61,17 @@ public class RMILauncher {
                }
        }
 
+       private static boolean runAccount() {
+               try {
+                       Remote remoteObject = new AccountManager();
+                       String authService = "rmi://localhost:9999//AcM";
+                       Naming.rebind(authService, remoteObject);
+                       return true;
+               } catch (Exception e) {
+                       System.out.println(e.toString());
+                       return false;
+               }
+       }
        
        private static boolean runBooking() {
                try {