|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpt.ua.concurrent.Channel<T>
public class Channel<T>
A simple module support a (generic) communication channel between two threads.
This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java
assert.
Constructor Summary | |
---|---|
Channel()
Creates a new channel registering waiting threads.. |
Method Summary | |
---|---|
void |
interruptWaitingThreads()
Requests the interruption all threads blocked on current channel. |
void |
put(T obj)
Put obj in channel. |
T |
take()
Get obj from channel. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Channel()
Method Detail |
---|
public void put(T obj)
obj
- reference to the object to be transmittedpublic T take()
public void interruptWaitingThreads() throws ThreadInterruptedException
ThreadInterruptedException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |