|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectthreadExamples.Channel<V,W>
V - The type of object used as a request.W - The type of object used as a response.public class Channel<V,W>
A pair of Queues, representing a two-way channel between Threads. The Queues are synchronized.
Although it isn't required, the intended use of a
Channel is asymmetric: One Thread puts requests
into the Channel, and another Thread services those
requests and returns a response.
| Constructor Summary | |
|---|---|
Channel()
Creates a new Channel (a pair of Queues). |
|
| Method Summary | |
|---|---|
V |
getRequest()
Gets an Object of type V from the request queue. |
W |
getResponse()
Gets an Object of type W from the response queue. |
void |
putRequest(V value)
Puts an Object of type V into the request queue. |
void |
putResponse(W value)
Puts an object of type W into the response queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Channel()
| Method Detail |
|---|
public void putRequest(V value)
V into the request queue.
value - The object to be added.public V getRequest()
V from the request queue.
public void putResponse(W value)
W into the response queue.
value - The object to be added.public W getResponse()
W from the response queue.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||