| EDU.oswego.cs.dl.util.concurrent.Takable
Takable | public interface Takable (Code) | | 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. ]
See Also: Channel See Also: Puttable |
Method Summary | |
public Object | poll(long msecs) Return and remove an item from channel only if one is available within
msecs milliseconds. | public Object | take() Return and remove an item from channel,
possibly waiting indefinitely until
such an item exists.
some item from the channel. |
poll | public Object poll(long msecs) throws InterruptedException(Code) | | Return and remove an item from channel only if one is available within
msecs milliseconds. The time bound is interpreted in a coarse
grained, best-effort fashion.
Parameters: msecs - the number of milliseconds to wait. If less thanor equal to zero, the operation does not perform any timed waits,but might still requireaccess to a synchronization lock, which can impose unboundeddelay if there is a lot of contention for the channel. some item, or null if the channel is empty. exception: InterruptedException - if the current thread hasbeen interrupted at a point at which interruptionis detected, in which case state of the channel is unchanged(i.e., equivalent to a false return). |
take | public Object take() throws InterruptedException(Code) | | Return and remove an item from channel,
possibly waiting indefinitely until
such an item exists.
some item from the channel. Different implementationsmay guarantee various properties (such as FIFO) about that item exception: InterruptedException - if the current thread hasbeen interrupted at a point at which interruptionis detected, in which case state of the channel is unchanged. |
|
|