@@ -32,6 +32,12 @@ public static void main(String[] args) throws AlreadyBoundException, NotBoundExc
32
32
Registry registry = LocateRegistry .createRegistry (Constant .RMI_PORT );
33
33
links = new HashMap <Integer , List <Link >>();
34
34
initializeEdges ();
35
+ for (int k : links .keySet ()){
36
+ System .out .println ("Node " + k + " has edges" );
37
+ for (Link l : links .get (k )){
38
+ System .out .println ("from " +l .getFrom ()+ " to " + l .getTo ()+ " with weight " +l .getWeight ());
39
+ }
40
+ }
35
41
// "clients" files contain the name of the remote processes used
36
42
BufferedReader br = new BufferedReader (new FileReader ("tests/nodes_cr4.txt" ));
37
43
String line = br .readLine ();
@@ -68,6 +74,9 @@ public static void main(String[] args) throws AlreadyBoundException, NotBoundExc
68
74
i ++;
69
75
}
70
76
br .close ();
77
+ for (int id :localIDS ){
78
+ System .out .println ("Local id " + id );
79
+ }
71
80
setRegistry ();
72
81
System .out .println ("Client 1 started" );
73
82
}
@@ -112,7 +121,7 @@ public static void initializeEdges() throws IOException{
112
121
public static void setRegistry () throws NotBoundException , NumberFormatException , IOException , InterruptedException {
113
122
Registry registry = LocateRegistry .getRegistry ("localhost" , Constant .RMI_PORT );
114
123
RMI_IDS = new IComponent [numProc ]; // the remote process array is instantiated
115
- Thread [] myThreads = new Thread [numProc ]; // and numProc number of threads are created
124
+ Thread [] myThreads = new Thread [localProc ]; // and numProc number of threads are created
116
125
boolean success ;
117
126
for (int i =0 ; i <numProc ; i ++){
118
127
success = false ;
@@ -130,6 +139,7 @@ public static void setRegistry() throws NotBoundException, NumberFormatException
130
139
131
140
for (int i =0 ; i <localProc ; i ++){
132
141
// initialization of each remote process of the client
142
+ System .out .println ("Process wiht id " + localIDS .get (i )+ " is initialized" );
133
143
RMI_IDS [localIDS .get (i )].setEntities (RMI_IDS );
134
144
// a new runnable remote process is created and is binded with the process i
135
145
RemoteProcess p = new RemoteProcess (RMI_IDS [localIDS .get (i )]);
@@ -140,6 +150,10 @@ public static void setRegistry() throws NotBoundException, NumberFormatException
140
150
while (RMI_IDS [i ].getEntities ()==null ){
141
151
System .err .println ("Node " +i +" not initialized yet" );
142
152
}
153
+ System .out .println ("Node " + i + " has array" );
154
+ for (IComponent temp : RMI_IDS [i ].getEntities ()){
155
+ System .out .println (temp .getID ());
156
+ }
143
157
}
144
158
System .out .println ("Tap when you are ready" );
145
159
System .in .read ();
0 commit comments