| |
|
| java.lang.Object java.nio.channels.spi.AbstractInterruptibleChannel java.nio.channels.SelectableChannel java.nio.channels.spi.AbstractSelectableChannel
All known Subclasses: java.nio.channels.DatagramChannel, java.nio.channels.SocketChannel, java.nio.channels.ServerSocketChannel,
AbstractSelectableChannel | abstract public class AbstractSelectableChannel extends SelectableChannel (Code) | | Base implementation class for selectable channels.
This class defines methods that handle the mechanics of channel
registration, deregistration, and closing. It maintains the current
blocking mode of this channel as well as its current set of selection keys.
It performs all of the synchronization required to implement the
java.nio.channels.SelectableChannel specification. Implementations of the
abstract protected methods defined in this class need not synchronize
against other threads that might be engaged in the same operations.
author: Mark Reinhold author: Mike McCloskey author: JSR-51 Expert Group version: 1.32, 07/05/05 since: 1.4 |
blocking | boolean blocking(Code) | | |
AbstractSelectableChannel | protected AbstractSelectableChannel(SelectorProvider provider)(Code) | | Initializes a new instance of this class.
|
implCloseSelectableChannel | abstract protected void implCloseSelectableChannel() throws IOException(Code) | | Closes this selectable channel.
This method is invoked by the
java.nio.channels.Channel.closeclose method in order to perform the actual work of closing the
channel. This method is only invoked if the channel has not yet been
closed, and it is never invoked more than once.
An implementation of this method must arrange for any other thread
that is blocked in an I/O operation upon this channel to return
immediately, either by throwing an exception or by returning normally.
|
implConfigureBlocking | abstract protected void implConfigureBlocking(boolean block) throws IOException(Code) | | Adjusts this channel's blocking mode.
This method is invoked by the
AbstractSelectableChannel.configureBlockingconfigureBlocking method in order to perform the actual work of
changing the blocking mode. This method is only invoked if the new mode
is different from the current mode.
throws: IOException - If an I/O error occurs |
isBlocking | final public boolean isBlocking()(Code) | | |
isRegistered | final public boolean isRegistered()(Code) | | |
provider | final public SelectorProvider provider()(Code) | | Returns the provider that created this channel.
The provider that created this channel |
register | final public SelectionKey register(Selector sel, int ops, Object att) throws ClosedChannelException(Code) | | Registers this channel with the given selector, returning a selection key.
This method first verifies that this channel is open and that the
given initial interest set is valid.
If this channel is already registered with the given selector then
the selection key representing that registration is returned after
setting its interest set to the given value.
Otherwise this channel has not yet been registered with the given
selector, so the
AbstractSelector.register register method of
the selector is invoked while holding the appropriate locks. The
resulting key is added to this channel's key set before being returned.
|
|
|
|