|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface OutputChannel<M>
The OutputChannel is the frontend of a Channel where messages can be put into. The OutputChannel can be compared to a java.io.OutputStream.
In JMS this is called the MessageProducer. In Java NIO it is called the sink channel. All OutputChannel implementations are threadsafe. An outputChannel can also be seen as a event listener. The OutputChannel is based on the: Puttable from the old concurrency library from Doug Lea. But it didn`t make it into JSE 5.0.
InputChannel| Method Summary | |
|---|---|
boolean |
offer(M msg,
long timeout,
java.util.concurrent.TimeUnit unit)
Place msg in channel only if it can be accepted within msecs milliseconds. |
void |
put(M msg)
Place msg in the channel, possibly waiting indefinitely until it can be accepted. |
| Method Detail |
|---|
void put(M msg)
throws java.lang.InterruptedException
msg - the element to be inserted. Should be non-null.
java.lang.InterruptedException - if the current thread has
been interrupted at a point at which interruption
is detected, in which case the element is guaranteed not
to be inserted. Otherwise, on normal return, the element is guaranteed
to have been inserted.
java.lang.NullPointerException - if msg is null.
boolean offer(M msg,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
msg - the element to be inserted. Should be non-null.timeout - how long to wait before giving up, in units of unit. If less than
or equal to zero, the method does not perform any timed waits,
but might still require access to a synchronization lock, which can impose
unbounded delay if there is a lot of contention for the channel.unit - the time unit of the timeout argument
java.lang.InterruptedException - if the current thread has
been interrupted at a point at which interruption
is detected, in which case the element is guaranteed not
to be inserted (i.e., is equivalent to a false return).
java.lang.NullPointerException - if message or unit is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||