Sdílet prostřednictvím


AbstractSelector Class

Definition

Base implementation class for selectors.

[Android.Runtime.Register("java/nio/channels/spi/AbstractSelector", DoNotGenerateAcw=true)]
public abstract class AbstractSelector : Java.Nio.Channels.Selector
[<Android.Runtime.Register("java/nio/channels/spi/AbstractSelector", DoNotGenerateAcw=true)>]
type AbstractSelector = class
    inherit Selector
Inheritance
AbstractSelector
Attributes

Remarks

Base implementation class for selectors.

This class encapsulates the low-level machinery required to implement the interruption of selection operations. A concrete selector class must invoke the #begin begin and #end end methods before and after, respectively, invoking an I/O operation that might block indefinitely. In order to ensure that the #end end method is always invoked, these methods should be used within a try&nbsp;...&nbsp;finally block:

<blockquote>

try {
                begin();
                // Perform blocking I/O operation here
                ...
            } finally {
                end();
            }

</blockquote>

This class also defines methods for maintaining a selector's cancelled-key set and for removing a key from its channel's key set, and declares the abstract #register register method that is invoked by a selectable channel's AbstractSelectableChannel#register register method in order to perform the actual work of registering a channel.

Added in 1.4.

Java documentation for java.nio.channels.spi.AbstractSelector.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

AbstractSelector(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

AbstractSelector(SelectorProvider)

Initializes a new instance of this class.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsOpen

Returns true if this selector is open.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Begin()

Marks the beginning of an I/O operation that might block indefinitely.

CancelledKeys()

Retrieves this selector's cancelled-key set.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Closes this selector.

Deregister(AbstractSelectionKey)

Removes the given key from its channel's key set.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
End()

Marks the end of an I/O operation that might block indefinitely.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
ImplCloseSelector()

Closes this selector.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Keys()

Returns this selector's key set.

(Inherited from Selector)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Provider()

Returns the provider that created this channel.

Register(AbstractSelectableChannel, Int32, Object)

Registers the given channel with this selector.

Select()

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

(Inherited from Selector)
Select(IConsumer, Int64)

Selects and performs an action on the keys whose corresponding channels are ready for I/O operations.

(Inherited from Selector)
Select(IConsumer)

Selects and performs an action on the keys whose corresponding channels are ready for I/O operations.

(Inherited from Selector)
Select(Int64)

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

(Inherited from Selector)
SelectedKeys()

Returns this selector's selected-key set.

(Inherited from Selector)
SelectNow()

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

(Inherited from Selector)
SelectNow(IConsumer)

Selects and performs an action on the keys whose corresponding channels are ready for I/O operations.

(Inherited from Selector)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wakeup()

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

(Inherited from Selector)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to