Udostępnij za pośrednictwem


SelectorProvider.Provider Method

Definition

Returns the system-wide default selector provider for this invocation of the Java virtual machine.

[Android.Runtime.Register("provider", "()Ljava/nio/channels/spi/SelectorProvider;", "")]
public static Java.Nio.Channels.Spi.SelectorProvider? Provider ();
[<Android.Runtime.Register("provider", "()Ljava/nio/channels/spi/SelectorProvider;", "")>]
static member Provider : unit -> Java.Nio.Channels.Spi.SelectorProvider

Returns

The system-wide default selector provider

Attributes

Remarks

Returns the system-wide default selector provider for this invocation of the Java virtual machine.

The first invocation of this method locates the default provider object as follows:

<ol>

<li>

If the system property java.nio.channels.spi.SelectorProvider is defined then it is taken to be the fully-qualified name of a concrete provider class. The class is loaded and instantiated; if this process fails then an unspecified error is thrown.

</li>

<li>

If a provider class has been installed in a jar file that is visible to the system class loader, and that jar file contains a provider-configuration file named java.nio.channels.spi.SelectorProvider in the resource directory META-INF/services, then the first class name specified in that file is taken. The class is loaded and instantiated; if this process fails then an unspecified error is thrown.

</li>

<li>

Finally, if no provider has been specified by any of the above means then the system-default provider class is instantiated and the result is returned.

</li>

</ol>

Subsequent invocations of this method return the provider that was returned by the first invocation.

Java documentation for java.nio.channels.spi.SelectorProvider.provider().

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.

Applies to