| seda.sandStorm.lib.aSocket.SelectSourceIF
All known Subclasses: seda.sandStorm.lib.aSocket.nbio.SelectSource, seda.sandStorm.lib.aSocket.nio.NIOSelectSource,
SelectSourceIF | public interface SelectSourceIF extends SourceIF(Code) | | A SelectSource is an implementation of SourceIF which pulls events from
the operating system via the NBIO SelectSet interface. This can be thought
of as a 'shim' which turns a SelectSet into a SourceIF.
SelectSource can also "balances" the set of events returned on
subsequent calls to dequeue, in order to avoid biasing the servicing of
underlying O/S events to a particular order. This feature can be
disabled by creating a SelectSource with the boolean flag 'do_balance'.
author: Matt Welsh |
Method Summary | |
public void | deregister(Object sel) Deregister a SelectItem with this SelectSource.
Note that after calling deregister, subsequent calls to dequeue
may in fact return this SelectItem as a result. | public int | numActive() Return the number of active SelectItems registered with the SelectSource. | public int | numRegistered() Return the number of SelectItems registered with the SelectSource. | public void | register(Object sel) Register a SelectItem with the SelectSource. | public Object | register(Object sc, int ops) | public int | size() Return the number of elements waiting in the queue (that is,
which don't require a SelectSet poll operation to retrieve). | public void | update() Must be called if the 'events' mask of any SelectItem registered
with this SelectSource changes. | public void | update(Object sel) Must be called if the 'events' mask of this SelectItem (which
must be registered with this SelectSource) changes. |
deregister | public void deregister(Object sel)(Code) | | Deregister a SelectItem with this SelectSource.
Note that after calling deregister, subsequent calls to dequeue
may in fact return this SelectItem as a result. This is because
the SelectQueue internally caches results.
|
numActive | public int numActive()(Code) | | Return the number of active SelectItems registered with the SelectSource.
An active SelectItem is one defined as having a non-zero events
interest mask.
|
numRegistered | public int numRegistered()(Code) | | Return the number of SelectItems registered with the SelectSource.
|
register | public void register(Object sel)(Code) | | Register a SelectItem with the SelectSource. The SelectItem should
generally correspond to a Selectable along with a set of event flags
that we wish this SelectSource to test for.
The user is allowed to modify the event flags in the SelectItem
directly (say, to cause the SelectSource ignore a given SelectItem for
the purposes of future calls to one of the dequeue methods). However,
modifying the event flags may not be synchronous with calls to dequeue -
generally because SelectSource maintains a cache of recently-received
events.
See Also: seda.nbio.Selectable |
size | public int size()(Code) | | Return the number of elements waiting in the queue (that is,
which don't require a SelectSet poll operation to retrieve).
|
update | public void update()(Code) | | Must be called if the 'events' mask of any SelectItem registered
with this SelectSource changes. Pushes event mask changes down to
the underlying event-dispatch mechanism.
|
update | public void update(Object sel)(Code) | | Must be called if the 'events' mask of this SelectItem (which
must be registered with this SelectSource) changes. Pushes
event mask changes down to the underlying event-dispatch mechanism.
|
|
|