English | Site Directory

Android - An Open Handset Alliance Project

java.nio.channels.spi
public abstract class

java.nio.channels.spi.AbstractSelector

java.lang.Object
java.nio.channels.Selector
java.nio.channels.spi.AbstractSelector

Abstract class for selectors.

This class realizes the interruption of selection by begin and end. It also holds the cancelled and the deletion of the key set.

Summary

Protected Constructors

          AbstractSelector(SelectorProvider selectorProvider)
Constructor for this class.

Public Methods

  synchronized  final    void  close()
Closes this channel.
    final    boolean  isOpen()
Tells whether this selector is open.
    final    SelectorProvider  provider()
Answers the SelectorProvider of this channel.

Protected Methods

    final    void  begin()
This starts a potentially blocking I/O operation
    final    Set  cancelledKeys()
Answers the cancelled key set of this channel.
    final    void  deregister(AbstractSelectionKey key)
Deletes the key from channel's key set.
    final    void  end()
This ends a potentially blocking I/O operation
abstract        void  implCloseSelector()
Implements the closing of this channel.
abstract        SelectionKey  register(AbstractSelectableChannel channel, int operations, Object attachment)
Registers a channel to this selector.
Methods inherited from class java.nio.channels.Selector
Methods inherited from class java.lang.Object

Details

Protected Constructors

protected AbstractSelector(SelectorProvider selectorProvider)

Constructor for this class.

Parameters

selectorProvider A instance of SelectorProvider

Public Methods

public final synchronized void close()

Closes this channel.

Throws

IOException

See Also

public final boolean isOpen()

Tells whether this selector is open.

See Also

public final SelectorProvider provider()

Answers the SelectorProvider of this channel.

See Also

Protected Methods

protected final void begin()

This starts a potentially blocking I/O operation

protected final Set cancelledKeys()

Answers the cancelled key set of this channel.

Returns

  • The cancelled key set.

protected final void deregister(AbstractSelectionKey key)

Deletes the key from channel's key set.

Parameters

key The key.

protected final void end()

This ends a potentially blocking I/O operation

protected abstract void implCloseSelector()

Implements the closing of this channel.

Throws

IOException If some I/O exception occurs.

protected abstract SelectionKey register(AbstractSelectableChannel channel, int operations, Object attachment)

Registers a channel to this selector.

Parameters

channel The channel to be registered.
operations The interest set.
attachment The attachment of the key.

Returns

  • The key related with the channel and the selector.
Build m5-rc15i - 10 Jun 2008 13:54