Class Overview
SelectorProvider
is an abstract base class that declares methods for
providing instances of DatagramChannel
, Pipe
,
Selector
, ServerSocketChannel
, and
SocketChannel
. All the methods of this class are thread-safe.
A provider instance can be retrieved through a system property or the
configuration file in a jar file; if no provide is available that way then
the system default provider is returned.
Summary
Public Methods |
Channel
|
inheritedChannel()
Returns the channel inherited from the instance that created this
virtual machine.
|
abstract
DatagramChannel
|
openDatagramChannel()
Creates a new open DatagramChannel .
|
abstract
Pipe
|
openPipe()
Creates a new Pipe .
|
abstract
AbstractSelector
|
openSelector()
Creates a new selector.
|
abstract
ServerSocketChannel
|
openServerSocketChannel()
Creates a new open ServerSocketChannel .
|
abstract
SocketChannel
|
openSocketChannel()
Create a new open SocketChannel .
|
synchronized
static
SelectorProvider
|
provider()
Gets a provider instance by executing the following steps when called for
the first time:
- if the system property "java.nio.channels.spi.SelectorProvider" is
set, the value of this property is the class name of the provider
returned;
- if there is a provider-configuration file named
"java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar
file valid in the system class loader, the first class name is the
provider's class name;
- otherwise, a system default provider will be returned.
|
[Expand]
Inherited Methods |
From class java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Is called before the object's memory is being reclaimed by the VM.
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of Class which represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
|
Protected Constructors
protected
SelectorProvider
()
Constructs a new SelectorProvider
.
Throws
SecurityException
| if there is a security manager installed that does not permit
the runtime permission labeled "selectorProvider". |
Public Methods
public
Channel
inheritedChannel
()
Returns the channel inherited from the instance that created this
virtual machine.
Throws
IOException
| if an I/O error occurs. |
SecurityException
| if there is a security manager installed that does not permit
the runtime permission labeled "selectorProvider". |
public
abstract
DatagramChannel
openDatagramChannel
()
Creates a new open DatagramChannel
.
public
abstract
Pipe
openPipe
()
public
abstract
ServerSocketChannel
openServerSocketChannel
()
Creates a new open ServerSocketChannel
.
public
abstract
SocketChannel
openSocketChannel
()
Create a new open SocketChannel
.
public
static
synchronized
SelectorProvider
provider
()
Gets a provider instance by executing the following steps when called for
the first time:
- if the system property "java.nio.channels.spi.SelectorProvider" is
set, the value of this property is the class name of the provider
returned;
- if there is a provider-configuration file named
"java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar
file valid in the system class loader, the first class name is the
provider's class name;
- otherwise, a system default provider will be returned.