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

Class Selector

java.lang.Object
|
+--java.nio.channels.Selector


public abstract class Selector

extends Object

Since:Author:

Constructor Summary

Selector()

Initializes the selector.

Method Summary

voidclose()

Closes the selector.
booleanisOpen()

Tells whether the selector is open or not.
java.util.Setkeys()

Returns this selector's key set.
static java.nio.channels.Selectoropen()

Opens a selector.
java.nio.channels.spi.SelectorProviderprovider()

Returns the SelectorProvider that created the selector.
intselect()

Selects a set of keys whose corresponding channels are ready for I/O operations.
intselect(long timeout)

Selects a set of keys whose corresponding channels are ready for I/O operations.
intselectNow()

Selects a set of keys whose corresponding channels are ready for I/O operations.
java.util.SetselectedKeys()

Returns this selector's selected-key set.
java.nio.channels.Selectorwakeup()

Causes the first selection operation that has not yet returned to return immediately.

Constructor Details

Selector

protected Selector()

Initializes the selector.


Method Details

close

public void close()

Closes the selector.

Throws:


isOpen

public boolean isOpen()

Tells whether the selector is open or not.


keys

public Set keys()

Returns this selector's key set.

Throws:


open

public static Selector open()

Opens a selector.

Throws:


provider

public SelectorProvider provider()

Returns the SelectorProvider that created the selector.


select

public int select()

Selects a set of keys whose corresponding channels are ready for I/O operations.

Throws:


select

public int select(long timeout)

Selects a set of keys whose corresponding channels are ready for I/O operations.

Parameters:

Throws:


selectNow

public int selectNow()

Selects a set of keys whose corresponding channels are ready for I/O operations.

Throws:


selectedKeys

public Set selectedKeys()

Returns this selector's selected-key set.

Throws:


wakeup

public Selector wakeup()

Causes the first selection operation that has not yet returned to return immediately.