Top Fields Constructors Methods
org.newsclub.net.unix

pack-priv final Class AFSelectionKey

extends SelectionKey
Class Inheritance
Imports
java.nio.channels.SelectableChannel, .SelectionKey, .Selector, java.nio.channels.spi.AbstractSelectableChannel, java.util.concurrent.atomic.AtomicBoolean

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private final SelectableChannel
private final AFSocketCore
private static final int
private int
private int
private final AFSelector
Inherited from java.nio.channels.SelectionKey:
OP_ACCEPTOP_CONNECTOP_READOP_WRITE

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Implements abstract java.nio.channels.SelectionKey.cancel.

Requests that the registration of this key's channel with its selector be cancelled.

private void
pack-priv void
public SelectableChannel
channel()

Implements abstract java.nio.channels.SelectionKey.channel.

Returns the channel for which this key was created.

pack-priv AFSocketCore
pack-priv boolean
public int
interestOps()

Implements abstract java.nio.channels.SelectionKey.interestOps.

Retrieves this key's interest set.

public SelectionKey
interestOps(int
The new interest set
interestOps
)

Implements abstract java.nio.channels.SelectionKey.interestOps.

Sets this key's interest set to the given value.

pack-priv boolean
pack-priv boolean
public boolean
isValid()

Implements abstract java.nio.channels.SelectionKey.isValid.

Tells whether or not this key is valid.

public int
readyOps()

Implements abstract java.nio.channels.SelectionKey.readyOps.

Retrieves this key's ready-operation set.

public Selector
selector()

Implements abstract java.nio.channels.SelectionKey.selector.

Returns the selector for which this key was created.

pack-priv void
setOpsReady(int opsReady)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.nio.channels.SelectionKey:
attachattachmentinterestOpsAndinterestOpsOrisAcceptableisConnectableisReadableisWritable

Field Detail

cancelledback to summary
private final AtomicBoolean cancelled
channback to summary
private final SelectableChannel chann
coreback to summary
private final AFSocketCore core
OP_INVALIDback to summary
private static final int OP_INVALID
opsback to summary
private int ops
opsReadyback to summary
private int opsReady
selback to summary
private final AFSelector sel

Constructor Detail

AFSelectionKeyback to summary
pack-priv AFSelectionKey(AFSelector selector, AbstractSelectableChannel ch, int ops, Object att)

Method Detail

cancelback to summary
public void cancel()

Implements abstract java.nio.channels.SelectionKey.cancel.

Doc from java.nio.channels.SelectionKey.cancel.

Requests that the registration of this key's channel with its selector be cancelled. Upon return the key will be invalid and will have been added to its selector's cancelled-key set. The key will be removed from all of the selector's key sets during the next selection operation.

If this key has already been cancelled then invoking this method has no effect. Once cancelled, a key remains forever invalid.

This method may be invoked at any time. It synchronizes on the selector's cancelled-key set, and therefore may block briefly if invoked concurrently with a cancellation or selection operation involving the same selector.

Annotations
@Override
cancel1back to summary
private void cancel1()
cancelNoRemoveback to summary
pack-priv void cancelNoRemove()
channelback to summary
public SelectableChannel channel()

Implements abstract java.nio.channels.SelectionKey.channel.

Doc from java.nio.channels.SelectionKey.channel.

Returns the channel for which this key was created. This method will continue to return the channel even after the key is cancelled.

Returns:SelectableChannel

This key's channel

Annotations
@Override
getAFCoreback to summary
pack-priv AFSocketCore getAFCore()
hasOpInvalidback to summary
pack-priv boolean hasOpInvalid()
interestOpsback to summary
public int interestOps()

Implements abstract java.nio.channels.SelectionKey.interestOps.

Doc from java.nio.channels.SelectionKey.interestOps.

Retrieves this key's interest set.

It is guaranteed that the returned set will only contain operation bits that are valid for this key's channel.

Returns:int

This key's interest set

Annotations
@Override
interestOpsback to summary
public SelectionKey interestOps(int interestOps)

Implements abstract java.nio.channels.SelectionKey.interestOps.

Doc from java.nio.channels.SelectionKey.interestOps.

Sets this key's interest set to the given value.

This method may be invoked at any time. If this method is invoked while a selection operation is in progress then it has no effect upon that operation; the change to the key's interest set will be seen by the next selection operation.

Parameters
interestOps:int

The new interest set

Returns:SelectionKey

This selection key

Annotations
@Override
isCancelledback to summary
pack-priv boolean isCancelled()
isSelectedback to summary
pack-priv boolean isSelected()
isValidback to summary
public boolean isValid()

Implements abstract java.nio.channels.SelectionKey.isValid.

Doc from java.nio.channels.SelectionKey.isValid.

Tells whether or not this key is valid.

A key is valid upon creation and remains so until it is cancelled, its channel is closed, or its selector is closed.

Returns:boolean

true if, and only if, this key is valid

Annotations
@Override
readyOpsback to summary
public int readyOps()

Implements abstract java.nio.channels.SelectionKey.readyOps.

Doc from java.nio.channels.SelectionKey.readyOps.

Retrieves this key's ready-operation set.

It is guaranteed that the returned set will only contain operation bits that are valid for this key's channel.

Returns:int

This key's ready-operation set

Annotations
@Override
selectorback to summary
public Selector selector()

Implements abstract java.nio.channels.SelectionKey.selector.

Doc from java.nio.channels.SelectionKey.selector.

Returns the selector for which this key was created. This method will continue to return the selector even after the key is cancelled.

Returns:Selector

This key's selector

Annotations
@Override
setOpsReadyback to summary
pack-priv void setOpsReady(int opsReady)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override