Android
java.nio.channels.spi
public abstract class

java.nio.channels.spi.SelectorProvider

java.lang.Object
java.nio.channels.spi.SelectorProvider

Provider for nio selector and selectable channel.

The provider can be got by system property or the configuration file in a jar file, if not, the system default provider will return. The main function of this class is to return the instance of implementation class of DatagramChannel, Pipe, Selector , ServerSocketChannel, and SocketChannel. All the methods of this class are multi-thread safe.

Summary

Protected Constructors

            SelectorProvider()
Constructor for this class.

Public Methods

          Channel  inheritedChannel()
Answer the channel inherited from the instance which created this JVM.
abstract          DatagramChannel  openDatagramChannel()
Create a new open DatagramChannel.
abstract          Pipe  openPipe()
Create a new Pipe.
abstract          AbstractSelector  openSelector()
Create a new selector.
abstract          ServerSocketChannel  openServerSocketChannel()
Create a new open ServerSocketChannel.
abstract          SocketChannel  openSocketChannel()
Create a new open SocketChannel.
  synchronized    static    SelectorProvider  provider()
Get the provider by following steps in the first calling.
Methods inherited from class java.lang.Object

Details

Protected Constructors

protected SelectorProvider()

Constructor for this class.

Throws

SecurityException If there is a security manager, and it denies RuntimePermission("selectorProvider").

Public Methods

public Channel inheritedChannel()

Answer the channel inherited from the instance which created this JVM.

Returns

  • The channel.

Throws

IOException If some I/O exception occurred.
SecurityException If there is a security manager, and it denies RuntimePermission("selectorProvider").

public abstract DatagramChannel openDatagramChannel()

Create a new open DatagramChannel.

Returns

  • The channel.

Throws

IOException If some I/O exception occurred.

public abstract Pipe openPipe()

Create a new Pipe.

Returns

  • The pipe.

Throws

IOException If some I/O exception occurred.

public abstract AbstractSelector openSelector()

Create a new selector.

Returns

  • The selector.

Throws

IOException If some I/O exception occurred.

public abstract ServerSocketChannel openServerSocketChannel()

Create a new open ServerSocketChannel.

Returns

  • The channel.

Throws

IOException If some I/O exception occurred.

public abstract SocketChannel openSocketChannel()

Create a new open SocketChannel.

Returns

  • The channel.

Throws

IOException If some I/O exception occurred.

public static synchronized SelectorProvider provider()

Get the provider by following steps in the first calling.

  • If the system property "java.nio.channels.spi.SelectorProvider" is set, the value of this property is the class name of the return provider.
  • If there is a provider-configuration file named "java.nio.channels.spi.SelectorProvider" in META-INF/services of some jar file valid in the system class loader, the first class name is the return provider's class name.
  • Otherwise, a system default provider will be returned.

Returns

  • The provider.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56