Skip to content

Commit 366115b

Browse files
Neil DEVASNeil DEVAS
authored andcommitted
setup server names
1 parent e8d9f02 commit 366115b

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

code/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.class
2+
*.jar

code/Client/Client/RMIClient.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ public class RMIClient extends Client
1717
private static String s_serverName = "Server";
1818

1919
//TODO: REPLACE 'ALEX' WITH YOUR GROUP NUMBER TO COMPILE
20-
// private static String s_rmiPrefix = "groupAlex_";
20+
private static String s_rmiPrefix = "group25_";
2121

2222
public static void main(String args[])
23-
{
23+
{
2424
if (args.length > 0)
2525
{
2626
s_serverHost = args[0];
@@ -46,8 +46,8 @@ public static void main(String args[])
4646
RMIClient client = new RMIClient();
4747
client.connectServer();
4848
client.start();
49-
}
50-
catch (Exception e) {
49+
}
50+
catch (Exception e) {
5151
System.err.println((char)27 + "[31;1mClient exception: " + (char)27 + "[0mUncaught exception");
5252
e.printStackTrace();
5353
System.exit(1);
@@ -91,4 +91,3 @@ public void connectServer(String server, int port, String name)
9191
}
9292
}
9393
}
94-

code/Client/java.policy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
grant codebase "file:/home/2016/ndevas/comp512/Project1/DistributedSystemsProject/code/Client/" {
2+
permission java.security.AllPermission;
3+
};

code/Server/Server/RMI/RMIResourceManager.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,25 @@
1616
import java.rmi.RemoteException;
1717
import java.rmi.server.UnicastRemoteObject;
1818

19-
public class RMIResourceManager extends ResourceManager
19+
// RMIResourceManager is a whole class containing a registry and references to objects
20+
// These objects can be created through "creators", i.e. addFlight, addCars, addRooms
21+
// After creation or updates, through creators/setters, the object is written to RNHashMap
22+
// RNHashMap takes a key and stores the object as the value
23+
// Read data simply pulls object values from this RNHashMap
24+
25+
public class RMIResourceManager extends ResourceManager
2026
{
2127
private static String s_serverName = "Server";
2228
//TODO: REPLACE 'ALEX' WITH YOUR GROUP NUMBER TO COMPILE
23-
// private static String s_rmiPrefix = "groupAlex_";
29+
private static String s_rmiPrefix = "group25_";
2430

2531
public static void main(String args[])
2632
{
2733
if (args.length > 0)
2834
{
2935
s_serverName = args[0];
3036
}
31-
37+
3238
// Create the RMI server entry
3339
try {
3440
// Create a new Server object
@@ -58,7 +64,7 @@ public void run() {
5864
e.printStackTrace();
5965
}
6066
}
61-
});
67+
});
6268
System.out.println("'" + s_serverName + "' resource manager server ready and bound to '" + s_rmiPrefix + s_serverName + "'");
6369
}
6470
catch (Exception e) {

code/Server/java.policy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
grant codebase "file:/home/2016/ndevas/comp512/Project1/DistributedSystemsProject/code/Server/" {
2+
permission java.security.AllPermission;
3+
};

0 commit comments

Comments
 (0)