|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
public abstract class AbstractSelectableChannel
Constructor Summary | |
---|---|
protected |
AbstractSelectableChannel(SelectorProvider provider)
Initializes the channel |
Method Summary | |
---|---|
Object |
blockingLock()
Retrieves the object upon which the configureBlocking and register methods synchronize. |
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. |
SelectionKey |
keyFor(Selector selector)
Retrieves the key representing the channel's registration with the given selector. |
SelectorProvider |
provider()
Returns the provider that created this channel. |
SelectionKey |
register(Selector selin,
int ops,
Object att)
Registers this channel with the given selector, returning a selection key. |
Methods inherited from class java.nio.channels.SelectableChannel |
---|
register, validOps |
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel |
---|
begin, close, end, isOpen |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractSelectableChannel(SelectorProvider provider)
provider
- the provider that created this channelMethod Detail |
---|
public final Object blockingLock()
blockingLock
in class SelectableChannel
public final SelectableChannel configureBlocking(boolean blocking) throws IOException
configureBlocking
in class SelectableChannel
blocking
- true if blocking should be enabled, false otherwise
IOException
- If an error occursprotected final void implCloseChannel() throws IOException
implCloseChannel
in class AbstractInterruptibleChannel
IOException
- If an error occursprotected abstract void implCloseSelectableChannel() throws IOException
IOException
- If an error occursprotected abstract void implConfigureBlocking(boolean blocking) throws IOException
blocking
- true if blocking should be enabled, false otherwise
IOException
- If an error occurspublic final boolean isBlocking()
isBlocking
in class SelectableChannel
public final boolean isRegistered()
isRegistered
in class SelectableChannel
public final SelectionKey keyFor(Selector selector)
keyFor
in class SelectableChannel
selector
- the selector to get a selection key for
public final SelectorProvider provider()
provider
in class SelectableChannel
public final SelectionKey register(Selector selin, int ops, Object att) throws ClosedChannelException
register
in class SelectableChannel
selin
- the seletor to useops
- the interested operationsatt
- an attachment for the returned selection key
ClosedChannelException
- If the channel is already closed.
IllegalBlockingModeException
- If the channel is configured in
blocking mode.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |