blob: 580a1495851da6466d99de436819c7030503f216 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
/* */ package NET.worlds.network;
/* */
/* */ import java.io.PrintStream;
/* */ import java.util.Vector;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ class WaitList
/* */ {
/* 21 */ private Vector<ConnectionWaiter> _waitList = new Vector();
/* */ private Object _parent;
/* */
/* */ protected WaitList(Object parent)
/* */ {
/* 26 */ this._parent = parent;
/* */ }
/* */
/* */ protected synchronized void addWaiter(ConnectionWaiter cw)
/* */ {
/* 31 */ if ((Galaxy.getDebugLevel() & 0x4000) > 0) {
/* 32 */ System.out.println(this._parent + ": waitForConnection(" + cw + ")");
/* */ }
/* 34 */ if (this._waitList.indexOf(cw) < 0)
/* 35 */ this._waitList.addElement(cw);
/* */ }
/* */
/* */ protected synchronized void abortWait(ConnectionWaiter cw) {
/* 39 */ assert (this._waitList.indexOf(cw) != -1);
/* 40 */ this._waitList.removeElement(cw);
/* */ }
/* */
/* */ protected synchronized void clear() {
/* 44 */ this._waitList = new Vector();
/* */ }
/* */
/* */ protected synchronized void notify(boolean connected)
/* */ {
/* 49 */ if (((Galaxy.getDebugLevel() & 0x4000) > 0) &&
/* 50 */ (this._waitList.size() > 0)) {
/* 51 */ System.out.println(this._parent + ": notify(" + connected + ")");
/* */ }
/* 53 */ for (int i = this._waitList.size() - 1; i >= 0; i--) {
/* 54 */ ConnectionWaiter cw = (ConnectionWaiter)this._waitList.elementAt(i);
/* */
/* 56 */ if ((Galaxy.getDebugLevel() & 0x4000) > 0) {
/* 57 */ System.out.println("\tnotifying " + cw);
/* */ }
/* 59 */ cw.connectionCallback(this._parent, connected);
/* 60 */ this._waitList.removeElementAt(i);
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\WaitList.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|