Top Fields Constructors Methods
io.netty.channel.nio

pack-priv final Class SelectedSelectionKeySetSelector

extends Selector
Class Inheritance
Imports
java.io.IOException, java.nio.channels.SelectionKey, .Selector, java.nio.channels.spi.SelectorProvider, java.util.Set

Field Summary

Modifier and TypeField and Description
private final Selector
private final SelectedSelectionKeySet

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.nio.channels.Selector.close.

Implements java.io.Closeable.close.

Closes this selector.
public boolean
isOpen()

Implements abstract java.nio.channels.Selector.isOpen.

Tells whether or not this selector is open.
public Set<SelectionKey>
keys()

Implements abstract java.nio.channels.Selector.keys.

Returns this selector's key set.
public SelectorProvider
provider()

Implements abstract java.nio.channels.Selector.provider.

Returns the provider that created this channel.
public int
select(long
If positive, block for up to timeout milliseconds, more or less, while waiting for a channel to become ready; if zero, block indefinitely; must not be negative
timeout
)

Implements abstract java.nio.channels.Selector.select.

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

Implements abstract java.nio.channels.Selector.select.

Selects a set of keys whose corresponding channels are ready for I/O operations.
public Set<SelectionKey>
selectedKeys()

Implements abstract java.nio.channels.Selector.selectedKeys.

Returns this selector's selected-key set.
public int
selectNow()

Implements abstract java.nio.channels.Selector.selectNow.

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

Implements abstract java.nio.channels.Selector.wakeup.

Causes the first selection operation that has not yet returned to return immediately.
Inherited from java.nio.channels.Selector:
openselectselectselectNow

Field Detail

delegateback to summary
private final Selector delegate
selectionKeysback to summary
private final SelectedSelectionKeySet selectionKeys

Constructor Detail

SelectedSelectionKeySetSelectorback to summary
pack-priv SelectedSelectionKeySetSelector(Selector delegate, SelectedSelectionKeySet selectionKeys)

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.nio.channels.Selector.close.

Implements java.io.Closeable.close.

Doc from java.nio.channels.Selector.close.

Closes this selector.

If a thread is currently blocked in one of this selector's selection methods then it is interrupted as if by invoking the selector's wakeup method.

Any uncancelled keys still associated with this selector are invalidated, their channels are deregistered, and any other resources associated with this selector are released.

If this selector is already closed then invoking this method has no effect.

After a selector is closed, any further attempt to use it, except by invoking this method or the wakeup method, will cause a ClosedSelectorException to be thrown.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
isOpenback to summary
public boolean isOpen()

Implements abstract java.nio.channels.Selector.isOpen.

Doc from java.nio.channels.Selector.isOpen.

Tells whether or not this selector is open.

Returns:boolean

true if, and only if, this selector is open

Annotations
@Override
keysback to summary
public Set<SelectionKey> keys()

Implements abstract java.nio.channels.Selector.keys.

Doc from java.nio.channels.Selector.keys.

Returns this selector's key set.

The key set is not directly modifiable. A key is removed only after it has been cancelled and its channel has been deregistered. Any attempt to modify the key set will cause an UnsupportedOperationException to be thrown.

The set is safe for use by multiple concurrent threads.

Returns:Set<SelectionKey>

This selector's key set

Annotations
@Override
providerback to summary
public SelectorProvider provider()

Implements abstract java.nio.channels.Selector.provider.

Doc from java.nio.channels.Selector.provider.

Returns the provider that created this channel.

Returns:SelectorProvider

The provider that created this channel

Annotations
@Override
selectback to summary
public int select(long timeout) throws IOException

Implements abstract java.nio.channels.Selector.select.

Doc from java.nio.channels.Selector.select.

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

This method performs a blocking selection operation. It returns only after at least one channel is selected, this selector's wakeup method is invoked, the current thread is interrupted, or the given timeout period expires, whichever comes first.

This method does not offer real-time guarantees: It schedules the timeout as if by invoking the Object#wait(long) method.

Parameters
timeout:long

If positive, block for up to timeout milliseconds, more or less, while waiting for a channel to become ready; if zero, block indefinitely; must not be negative

Returns:int

The number of keys, possibly zero, whose ready-operation sets now indicate readiness for at least one category of operations for which the channel was not previously detected to be ready

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
selectback to summary
public int select() throws IOException

Implements abstract java.nio.channels.Selector.select.

Doc from java.nio.channels.Selector.select.

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

This method performs a blocking selection operation. It returns only after at least one channel is selected, this selector's wakeup method is invoked, or the current thread is interrupted, whichever comes first.

Returns:int

The number of keys, possibly zero, whose ready-operation sets now indicate readiness for at least one category of operations for which the channel was not previously detected to be ready

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
selectedKeysback to summary
public Set<SelectionKey> selectedKeys()

Implements abstract java.nio.channels.Selector.selectedKeys.

Doc from java.nio.channels.Selector.selectedKeys.

Returns this selector's selected-key set.

Keys may be removed from, but not directly added to, the selected-key set. Any attempt to add an object to the key set will cause an UnsupportedOperationException to be thrown.

The selected-key set is not thread-safe.

Returns:Set<SelectionKey>

This selector's selected-key set

Annotations
@Override
selectNowback to summary
public int selectNow() throws IOException

Implements abstract java.nio.channels.Selector.selectNow.

Doc from java.nio.channels.Selector.selectNow.

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

This method performs a non-blocking selection operation. If no channels have become selectable since the previous selection operation then this method immediately returns zero.

Invoking this method clears the effect of any previous invocations of the wakeup method.

Returns:int

The number of keys, possibly zero, whose ready-operation sets now indicate readiness for at least one category of operations for which the channel was not previously detected to be ready

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
wakeupback to summary
public Selector wakeup()

Implements abstract java.nio.channels.Selector.wakeup.

Doc from java.nio.channels.Selector.wakeup.

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

If another thread is currently blocked in a selection operation then that invocation will return immediately. If no selection operation is currently in progress then the next invocation of a selection operation will return immediately unless selectNow() or selectNow(Consumer) is invoked in the meantime. In any case the value returned by that invocation may be non-zero. Subsequent selection operations will block as usual unless this method is invoked again in the meantime.

Invoking this method more than once between two successive selection operations has the same effect as invoking it just once.

Returns:Selector

This selector

Annotations
@Override