54 |
this.state = 0; |
this.state = 0; |
55 |
} |
} |
56 |
|
|
57 |
protected void receive(Object o) { |
public void receive(Object o) { |
58 |
if(state != 0) |
if(state != 0) |
59 |
throw new IllegalStateException("Cannot receive more elements"); |
throw new IllegalStateException("Cannot receive more elements"); |
60 |
|
|
67 |
} |
} |
68 |
} |
} |
69 |
|
|
70 |
protected synchronized void finish(boolean timeout) { |
public synchronized void finish(boolean timeout) { |
71 |
state = timeout ? -1 : 1; |
state = timeout ? -1 : 1; |
72 |
|
|
73 |
|
for(Iterator i=listeners.iterator(); i.hasNext();) { |
74 |
|
CollectionListener l = (CollectionListener)i.next(); |
75 |
|
l.finish(timeout); |
76 |
|
} |
77 |
notifyAll(); |
notifyAll(); |
78 |
} |
} |
79 |
|
|
145 |
queue.notifyAll(); |
queue.notifyAll(); |
146 |
return true; |
return true; |
147 |
} |
} |
148 |
|
public void finish(boolean timeout) { |
149 |
|
} |
150 |
}); |
}); |
151 |
return new Iterator() { |
return new Iterator() { |
152 |
public boolean hasNext() { |
public boolean hasNext() { |