Methods Summary |
---|
public abstract java.lang.Object | blockingLock()Gets the blocking lock which synchronizes the {@code configureBlocking}
and {@code register} methods.
|
public abstract java.nio.channels.SelectableChannel | configureBlocking(boolean block)Sets the blocking mode of this channel. A call to this method blocks if
other calls to this method or to a {@code register} method are executing.
The new blocking mode is valid for calls to other methods that are
invoked after the call to this method. If other methods are already
executing when this method is called, they still have the old mode and
the call to this method might block depending on the implementation.
|
public abstract boolean | isBlocking()Indicates whether this channel is in blocking mode.
|
public abstract boolean | isRegistered()Indicates whether this channel is registered with at least one selector.
|
public abstract java.nio.channels.SelectionKey | keyFor(java.nio.channels.Selector sel)Gets this channel's selection key for the specified selector.
|
public abstract java.nio.channels.spi.SelectorProvider | provider()Gets the provider of this channel.
|
public final java.nio.channels.SelectionKey | register(java.nio.channels.Selector selector, int operations)Registers this channel with the specified selector for the specified
interest set. If the channel is already registered with the selector, the
corresponding selection key is returned but the
{@link SelectionKey interest set} is updated to {@code operations}. The
returned key is canceled if the channel is closed while registering is in
progress.
Calling this method is valid at any time. If another thread executes this
method or the {@code configureBlocking(boolean} method then this call is
blocked until the other call finishes. After that, it will synchronize on
the key set of the selector and thus may again block if other threads
also hold locks on the key set of the same selector.
Calling this method is equivalent to calling
{@code register(selector, operations, null)}.
return register(selector, operations, null);
|
public abstract java.nio.channels.SelectionKey | register(java.nio.channels.Selector sel, int ops, java.lang.Object att)Registers this channel with the specified selector for the specified
interest set and an object to attach. If the channel is already
registered with the selector, the corresponding selection key is returned
but its {@link SelectionKey interest set} is updated to {@code ops} and
the attached object is updated to {@code att}. The returned key is
canceled if the channel is closed while registering is in progress.
Calling this method is valid at any time. If another thread executes this
method or the {@code configureBlocking(boolean)} method then this call is
blocked until the other call finishes. After that, it will synchronize on
the key set of the selector and thus may again block if other threads
also hold locks on the key set of the same selector.
|
public abstract int | validOps()Gets the set of valid {@link SelectionKey operations} of this channel.
Instances of a concrete channel class always return the same value.
|