Android
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()
Returns the SelectorProvider of this channel.

Protected Methods

    final      void  begin()
This starts a potentially blocking I/O operation
    final      Set<SelectionKey cancelledKeys()
Returns 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.

Returns

  • true if this selector is not closed

See Also

public final SelectorProvider provider()

Returns the SelectorProvider of this channel.

Returns

  • the provider of this selector

See Also

Protected Methods

protected final void begin()

This starts a potentially blocking I/O operation

protected final Set<SelectionKey> cancelledKeys()

Returns 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.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48