|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface Takable
This interface exists to enable stricter type checking for channels. A method argument or instance variable in a consumer object can be declared as only a Takable rather than a Channel, in which case a Java compiler will disallow put operations.
Full method descriptions appear in the Channel interface.
[ Introduction to this package. ]
Channel,
Puttable| 方法摘要 | |
|---|---|
Object |
poll(long msecs)
Return and remove an item from channel only if one is available within msecs milliseconds. |
Object |
take()
Return and remove an item from channel, possibly waiting indefinitely until such an item exists. |
| 方法详细信息 |
|---|
Object take()
throws InterruptedException
InterruptedException - if the current thread has
been interrupted at a point at which interruption
is detected, in which case state of the channel is unchanged.
Object poll(long msecs)
throws InterruptedException
msecs - the number of milliseconds to wait. If less than
or equal to zero, the operation 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.
InterruptedException - if the current thread has
been interrupted at a point at which interruption
is detected, in which case state of the channel is unchanged
(i.e., equivalent to a false return).
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||