6
|
1 package alice.codesegment;
|
|
2
|
|
3 import java.util.concurrent.ConcurrentHashMap;
|
|
4 import java.util.concurrent.LinkedBlockingQueue;
|
|
5
|
|
6 public class CodeSegmentManager {
|
|
7 private static CodeSegmentManager instance = new CodeSegmentManager();
|
|
8 private LinkedBlockingQueue<Reply> replyQueue = new LinkedBlockingQueue<Reply>();
|
|
9 private ConcurrentHashMap<Integer, CodeSegment> seqHash = new ConcurrentHashMap<Integer, CodeSegment>();
|
|
10
|
|
11 private CodeSegmentManager() {
|
|
12 Runnable replyThread = new Runnable() {
|
|
13
|
|
14 @Override
|
|
15 public void run() {
|
|
16 while (true) {
|
|
17 try {
|
|
18 Reply reply = replyQueue.take();
|
|
19
|
|
20 } catch (InterruptedException e) {
|
|
21 e.printStackTrace();
|
|
22 }
|
|
23 }
|
|
24
|
|
25 }
|
|
26 };
|
|
27 }
|
|
28
|
|
29 public void create(CodeSegment cs) {
|
|
30 }
|
|
31
|
|
32 public static CodeSegmentManager get() {
|
|
33 return instance;
|
|
34 }
|
|
35 }
|