public abstract class AbstractSelectableChannel extends java.nio.channels.SelectableChannel
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSelectableChannel(SelectorProvider provider)
Initializes the channel
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
blockingLock()
Retrieves the object upon which the configureBlocking and register
methods synchronize.
|
java.nio.channels.SelectableChannel |
configureBlocking(boolean blocking)
Adjusts this channel's blocking mode.
|
protected void |
implCloseChannel()
Closes this channel.
|
protected abstract void |
implCloseSelectableChannel()
Closes this selectable channel.
|
protected abstract void |
implConfigureBlocking(boolean blocking)
Adjusts this channel's blocking mode.
|
boolean |
isBlocking()
Tells whether or not every I/O operation on this channel will block
until it completes.
|
boolean |
isRegistered()
Tells whether or not this channel is currently registered with
any selectors.
|
java.nio.channels.SelectionKey |
keyFor(java.nio.channels.Selector selector)
Retrieves the key representing the channel's registration with the
given selector.
|
SelectorProvider |
provider()
Returns the provider that created this channel.
|
java.nio.channels.SelectionKey |
register(java.nio.channels.Selector selin,
int ops,
java.lang.Object att)
Registers this channel with the given selector, returning a selection key.
|
begin, close, end, isOpenprotected AbstractSelectableChannel(SelectorProvider provider)
provider - the provider that created this channelpublic final java.lang.Object blockingLock()
blockingLock in class java.nio.channels.SelectableChannelpublic final java.nio.channels.SelectableChannel configureBlocking(boolean blocking) throws java.io.IOException
configureBlocking in class java.nio.channels.SelectableChannelblocking - true if blocking should be enabled, false otherwisejava.io.IOException - If an error occursprotected final void implCloseChannel() throws java.io.IOException
implCloseChannel in class AbstractInterruptibleChanneljava.io.IOException - If an error occursprotected abstract void implCloseSelectableChannel() throws java.io.IOException
java.io.IOException - If an error occursprotected abstract void implConfigureBlocking(boolean blocking) throws java.io.IOException
blocking - true if blocking should be enabled, false otherwisejava.io.IOException - If an error occurspublic final boolean isBlocking()
isBlocking in class java.nio.channels.SelectableChannelpublic final boolean isRegistered()
isRegistered in class java.nio.channels.SelectableChannelpublic final java.nio.channels.SelectionKey keyFor(java.nio.channels.Selector selector)
keyFor in class java.nio.channels.SelectableChannelselector - the selector to get a selection key forpublic final SelectorProvider provider()
provider in class java.nio.channels.SelectableChannelpublic final java.nio.channels.SelectionKey register(java.nio.channels.Selector selin, int ops, java.lang.Object att) throws java.nio.channels.ClosedChannelException
register in class java.nio.channels.SelectableChannelselin - the seletor to useops - the interested operationsatt - an attachment for the returned selection keyjava.nio.channels.ClosedChannelException - If the channel is already closed.java.nio.channels.IllegalBlockingModeException - If the channel is configured in
blocking mode.