annotate src/fdl/FederatedLinda.java @ 101:d671c78d3757 fuchita

share selector in FDLindaServe and FederatedLinda
author one
date Wed, 26 May 2010 15:57:23 +0900
parents 270093b61001
children 8ae522e1a4bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
1
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
2 /*
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
3 * @(#)FederatedLinda.java 1.1 06/04/01
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
4 *
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
5 * Copyright 2006 Shinji KONO
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
6 *
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
7
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
8 PSX Lidna
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
9 Trasport layer of PSX Linda library
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
10
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
11 */
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
12
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
13 package fdl;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
14
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
15 import java.io.IOException;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
16 import java.nio.ByteBuffer;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
17 import java.nio.channels.ClosedSelectorException;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
18 import java.nio.channels.SelectionKey;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
19 import java.nio.channels.Selector;
101
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
20 import java.nio.channels.spi.AbstractSelector;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
21 import java.util.Hashtable;
31
846c6c14cf04 worked?
kono
parents: 25
diff changeset
22 import java.util.Iterator;
40
046feb56a196 message logging
kono
parents: 39
diff changeset
23 import java.util.logging.Level;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
24
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
25 /**
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
26 FederatedLinda
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
27 *
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
28 * @author Shinji Kono
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
29 *
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
30 * @param mytsid Tuple Space ID
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
31
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
32 Initialize connection channel for a tuple space
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
33
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
34 one instance for each Tuple space connection
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
35
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
36 */
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
37
17
609b288f47f9 *** empty log message ***
kono
parents: 15
diff changeset
38 public class FederatedLinda {
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
39
35
fe338d497c72 FederatedLinda was static singleton. It does not work on Thread based test.
kono
parents: 34
diff changeset
40 FederatedLinda fdl;
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
41 static int MAX_SEQUENCE = 2048;
96
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
42 public static boolean debug = false;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
43
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
44 public int tid;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
45 public int seq;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
46 public int qsize;
25
330fa49bc4fd *** empty log message ***
kono
parents: 24
diff changeset
47 public PSXLinda linda;
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
48
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
49 public Selector selector;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
50
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
51 public PSXQueue q_top,q_end;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
52 public PSXReply r_top,r_end;
101
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
53 public Hashtable<Integer,PSXReply> seqHash = new Hashtable<Integer, PSXReply>();
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
54
22
56e015e8f5dc Testing TestLindaServer
kono
parents: 21
diff changeset
55 public static FederatedLinda init() {
35
fe338d497c72 FederatedLinda was static singleton. It does not work on Thread based test.
kono
parents: 34
diff changeset
56 FederatedLinda fdl = new FederatedLinda();
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
57 return fdl;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
58 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
59
101
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
60 public static FederatedLinda init(Selector selector) {
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
61 FederatedLinda fdl = new FederatedLinda(selector);
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
62 return fdl;
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
63 }
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
64
22
56e015e8f5dc Testing TestLindaServer
kono
parents: 21
diff changeset
65 private FederatedLinda() {
56e015e8f5dc Testing TestLindaServer
kono
parents: 21
diff changeset
66 try {
56e015e8f5dc Testing TestLindaServer
kono
parents: 21
diff changeset
67 selector = Selector.open();
56e015e8f5dc Testing TestLindaServer
kono
parents: 21
diff changeset
68 } catch (IOException e) {
56e015e8f5dc Testing TestLindaServer
kono
parents: 21
diff changeset
69 e.printStackTrace();
56e015e8f5dc Testing TestLindaServer
kono
parents: 21
diff changeset
70 }
101
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
71 }
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
72
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
73 public FederatedLinda(Selector selector) {
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
74 this.selector = selector;
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
75 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
76
25
330fa49bc4fd *** empty log message ***
kono
parents: 24
diff changeset
77 public PSXLinda open(String _host,int _port)
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
78 throws IOException {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
79 tid++;
39
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
80 PSXLindaImpl newlinda = new PSXLindaImpl(this,selector,tid,_host,_port);
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
81 linda = newlinda.add(linda);
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
82 return linda;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
83 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
84
39
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
85 PSXLinda openFromMetaLinda(MetaLinda metaLinda, String _host, int _port)
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
86 throws IOException {
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
87 tid++;
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
88 PSXLindaImpl newlinda = new PSXLindaImpl(this,metaLinda.fds.selector,tid,_host,_port);
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
89 linda = newlinda.add(linda);
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
90 return newlinda;
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
91 }
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
92
23
b4fd7fb9135a Simple Test run.
kono
parents: 22
diff changeset
93 public PSXReply psx_queue(PSXLinda linda, int id, ByteBuffer s, int mode, PSXCallback callback) {
b4fd7fb9135a Simple Test run.
kono
parents: 22
diff changeset
94 PSXQueue c = new PSXQueue(linda,id,mode,s,callback);
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
95
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
96 if (q_top == null) {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
97 c = q_end = q_top = c;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
98 } else {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
99 q_end.next = c;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
100 q_end = c;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
101 }
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
102 qsize++;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
103
17
609b288f47f9 *** empty log message ***
kono
parents: 15
diff changeset
104 if (mode != PSX.PSX_OUT) {
609b288f47f9 *** empty log message ***
kono
parents: 15
diff changeset
105 PSXReply p = new PSXReply(PSX.PSX_REPLY,callback);
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
106 p.seq = seq(p);
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
107 c.setSeq(p.seq);
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
108 if (r_top == null){
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
109 r_end = r_top = p;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
110 } else {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
111 r_end.next = p;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
112 r_end = p;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
113 }
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
114 return p;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
115 }
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
116 return null;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
117 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
118
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
119 public int seq(PSXReply reply) {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
120 Integer s;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
121 do {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
122 seq++;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
123 if (seq>MAX_SEQUENCE) {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
124 seq = 0;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
125 }
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
126 s = new Integer(seq);
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
127 } while (seqHash.containsKey(s));
96
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
128 // log(Level.INFO,"hash value = "+s.hashCode());
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
129 seqHash.put(s,reply);
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
130 seq++;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
131 return seq-1;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
132 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
133
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
134 public Selector selector() {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
135 return selector;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
136 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
137
96
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
138 /**
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
139 * sync with no wait
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
140 * @return 0
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
141 * @throws IOException
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
142 */
100
270093b61001 Fix meta.out(id,data) is not correctly handled.
one
parents: 96
diff changeset
143 public int sync() {
96
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
144 int key_num = 0;
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
145 queueExec();
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
146
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
147 try {
100
270093b61001 Fix meta.out(id,data) is not correctly handled.
one
parents: 96
diff changeset
148 if (selector.selectNow()>0) {
96
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
149 for (Iterator<SelectionKey> it = selector.selectedKeys().iterator();it.hasNext(); ) {
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
150 SelectionKey s = it.next();
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
151 it.remove();
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
152 try {
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
153 if (!s.isReadable())
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
154 throw new IOException();
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
155 TupleHandler handle = (TupleHandler)s.attachment();
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
156 handle.handle(s);
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
157 } catch (IOException e) {
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
158 s.cancel();
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
159 log(Level.INFO,""+s.channel()+" is closed.");
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
160 }
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
161 }
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
162 }
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
163 } catch (IOException e) {
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
164 e.printStackTrace();
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
165 } catch (ClosedSelectorException e) {
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
166 // client should be know
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
167 }
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
168
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
169 return key_num;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
170 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
171
96
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
172 /**
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
173 * sync with mtimeout msec wait
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
174 * @param mtimeout 0 means indifinite wait
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
175 * @return 0
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
176 * @throws IOException
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
177 */
100
270093b61001 Fix meta.out(id,data) is not correctly handled.
one
parents: 96
diff changeset
178 public int sync(long mtimeout) {
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
179 int key_num = 0;
39
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
180 queueExec();
2
b49e593b2502 Add ComDebug_Client
fuchita
parents: 0
diff changeset
181
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
182 try {
31
846c6c14cf04 worked?
kono
parents: 25
diff changeset
183 if (selector.select(mtimeout)>0) {
846c6c14cf04 worked?
kono
parents: 25
diff changeset
184 for (Iterator<SelectionKey> it = selector.selectedKeys().iterator();it.hasNext(); ) {
846c6c14cf04 worked?
kono
parents: 25
diff changeset
185 SelectionKey s = it.next();
846c6c14cf04 worked?
kono
parents: 25
diff changeset
186 it.remove();
33
64071f8e2e0d *** empty log message ***
kono
parents: 32
diff changeset
187 try {
34
e7c5958fd285 *** empty log message ***
kono
parents: 33
diff changeset
188 if (!s.isReadable())
e7c5958fd285 *** empty log message ***
kono
parents: 33
diff changeset
189 throw new IOException();
39
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
190 TupleHandler handle = (TupleHandler)s.attachment();
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
191 handle.handle(s);
33
64071f8e2e0d *** empty log message ***
kono
parents: 32
diff changeset
192 } catch (IOException e) {
34
e7c5958fd285 *** empty log message ***
kono
parents: 33
diff changeset
193 s.cancel();
40
046feb56a196 message logging
kono
parents: 39
diff changeset
194 log(Level.INFO,""+s.channel()+" is closed.");
33
64071f8e2e0d *** empty log message ***
kono
parents: 32
diff changeset
195 }
64071f8e2e0d *** empty log message ***
kono
parents: 32
diff changeset
196 }
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
197 }
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
198 } catch (IOException e) {
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
199 e.printStackTrace();
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
200 } catch (ClosedSelectorException e) {
36
d5bca4b5ee95 meta.sync() recursive call fix.
kono
parents: 35
diff changeset
201 // client should be know
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
202 }
2
b49e593b2502 Add ComDebug_Client
fuchita
parents: 0
diff changeset
203
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
204 return key_num;
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
205 }
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
206
86
c0591636a71a (no commit message)
one
parents: 40
diff changeset
207 public void queueExec() {
39
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
208 while (q_top != null){
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
209 PSXQueue c = q_top;
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
210 c.send();
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
211 q_top = c.next;
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
212 qsize--;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
213 }
11
1355eb28e41d fix seqHash removal on checkServe.
kono
parents: 2
diff changeset
214 }
39
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
215
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
216 PSXReply getReply(int rseq) {
24
35375016b2f0 cleanup.
kono
parents: 23
diff changeset
217 Integer a;
35375016b2f0 cleanup.
kono
parents: 23
diff changeset
218
35375016b2f0 cleanup.
kono
parents: 23
diff changeset
219 PSXReply r = seqHash.get((a = new Integer(rseq)));
35375016b2f0 cleanup.
kono
parents: 23
diff changeset
220 seqHash.remove(a);
35375016b2f0 cleanup.
kono
parents: 23
diff changeset
221 return r;
35375016b2f0 cleanup.
kono
parents: 23
diff changeset
222 }
39
81abceebc869 *** empty log message ***
kono
parents: 38
diff changeset
223
40
046feb56a196 message logging
kono
parents: 39
diff changeset
224 public void log(Level level,String msg) {
96
96c63bc659d4 change sync() for no wait sync. (sorry for this)
one
parents: 95
diff changeset
225 if (level!=Level.SEVERE && !debug) return;
40
046feb56a196 message logging
kono
parents: 39
diff changeset
226 System.err.println(msg);
046feb56a196 message logging
kono
parents: 39
diff changeset
227 if (level==Level.SEVERE)
046feb56a196 message logging
kono
parents: 39
diff changeset
228 new IOException().setStackTrace(null);
046feb56a196 message logging
kono
parents: 39
diff changeset
229 }
93
a1d796c0e975 Wait Read Tester
one
parents: 40
diff changeset
230
a1d796c0e975 Wait Read Tester
one
parents: 40
diff changeset
231 public void wakeup() {
a1d796c0e975 Wait Read Tester
one
parents: 40
diff changeset
232 selector.wakeup();
a1d796c0e975 Wait Read Tester
one
parents: 40
diff changeset
233 }
101
d671c78d3757 share selector in FDLindaServe and FederatedLinda
one
parents: 100
diff changeset
234
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
235 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
236
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
237 /* end */