Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.nio.channels

Class SelectableChannel

java.lang.Object
|
+--java.nio.channels.spi.AbstractInterruptibleChannel
   |
   +--java.nio.channels.SelectableChannel


public abstract class SelectableChannel

extends AbstractInterruptibleChannel

Since:Author:

Constructor Summary

SelectableChannel()

Initializes the channel.

Method Summary

java.lang.ObjectblockingLock()

Returns the lock of this channel.
java.nio.channels.SelectableChannelconfigureBlocking(boolean block)

Adjusts this channel's blocking mode.
booleanisBlocking()

Tells whether this channel is blocking or not.
booleanisRegistered()

Tells whether or not this channel is currently registered with any selectors.
java.nio.channels.SelectionKeykeyFor(java.nio.channels.Selector sel)

Retrieves the key representing the channel's registration with the given selector.
java.nio.channels.spi.SelectorProviderprovider()

Returns the provider that created this channel.
java.nio.channels.SelectionKeyregister(java.nio.channels.Selector sel, int ops)

Registers this channel with the given selector, returning a selection key.
java.nio.channels.SelectionKeyregister(java.nio.channels.Selector sel, int ops, java.lang.Object att)

Registers this channel with the given selector, returning a selection key.
intvalidOps()

Returns a set of valid operations on this channel.

Constructor Details

SelectableChannel

protected SelectableChannel()

Initializes the channel.


Method Details

blockingLock

public Object blockingLock()

Returns the lock of this channel.


configureBlocking

public SelectableChannel configureBlocking(boolean block)

Adjusts this channel's blocking mode.

Parameters:

Throws:


isBlocking

public boolean isBlocking()

Tells whether this channel is blocking or not.


isRegistered

public boolean isRegistered()

Tells whether or not this channel is currently registered with any selectors.


keyFor

public SelectionKey keyFor(java.nio.channels.Selector sel)

Retrieves the key representing the channel's registration with the given selector.

Parameters:


provider

public SelectorProvider provider()

Returns the provider that created this channel.


register

public final SelectionKey register(java.nio.channels.Selector sel, int ops)

Registers this channel with the given selector, returning a selection key.

Parameters:

Throws:


register

public SelectionKey register(java.nio.channels.Selector sel, int ops, java.lang.Object att)

Registers this channel with the given selector, returning a selection key.

Parameters:

Throws:


validOps

public int validOps()

Returns a set of valid operations on this channel.