blob: 10eecc1ea87ed75f9853fbac4b1377e4e944df53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package com.orbekk.util;
import java.util.ArrayList;
import java.util.List;
import com.orbekk.protobuf.Rpc;
public class RpcList {
private List<Rpc> rpcs = new ArrayList<Rpc>();
public synchronized void add(Rpc rpc) {
rpcs.add(rpc);
}
public synchronized void awaitAll() throws InterruptedException {
for (Rpc rpc : rpcs) {
rpc.await();
}
rpcs.clear();
}
}
|