public class Channel<T>
extends java.lang.Object
This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java assert.
| Constructor and Description |
|---|
Channel()
Creates a new channel registering waiting threads..
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public void put(T obj)
obj - reference to the object to be transmittedpublic T take()
public void interruptWaitingThreads()
throws ThreadInterruptedException
ThreadInterruptedException