- Ron Sigal
Copyright (c) April 8, 2006
is a simple version of
. It allows a thread to
s to notify it that they have bytes ready to read.
private boolean open = true;
to register itself and an attachment.
to unregister itself.
to wait to be informed of InputStreams that have bytes ready to read.
Map from a set of
InputStreams with ready bytes to their attachments.
close() is called while a
Thread is waiting in
select(), and if there are
select() will return null.
Returns true if and only if this
- true if and only if this
VirtualSelector is open
as preparing to close.
is blocked in
public synchronized void close()
to inform a listening
that it has bytes ready to read.
throw new IOException("This VirtualSelector is closed.");
Indicates that an
has been processed.
has no available bytes, it
will be removed from the
that will be returned by the next call to
has available bytes,
its status will not be changed.
log.debug("waiting until empty");
Finishes the process of closing this
, releasing all resources.