|
Jumpi v1.2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Selector provides synchronization support for multiple concurrent sending
or receiving operations. Handles are registered or unregistered from a
Selector which is retrieved from a Jumpi instance with Jumpi.getSelector()
A Jumpi client application can use a Selector to wait ( without polling )
using select()
until any one of the registered Handles has become
non blocking, which means completed, either successfully or unsuccessfully.
Selectors do not differentiate between Handles used for sending or receiving operations.
Method Summary | |
void |
addHandle(Handle hdl)
Register a sending or receiving Handle with the Selector. |
void |
clear()
Remove all registered Handles. |
java.util.Vector |
getAllHandles()
Return a complete list of Handles. |
java.util.Vector |
getBlockingHandles()
Return a list on blocking Handles. |
java.util.Vector |
getNonBlockingHandles()
Return a list on non blocking Handles. |
Handle |
removeBlockingHandle()
Remove any blocking Handle or null if there is no blocking Handle. |
java.util.Vector |
removeBlockingHandles()
Remove and return all blocking Handles which exist in the Selector. |
void |
removeHandle(Handle hdl)
Unregister a sending or receiving Handle with the Selector. |
Handle |
removeNonBlockingHandle()
Remove any non blocking Handle or null if there is no non blocking Handle. |
java.util.Vector |
removeNonBlockingHandles()
Remove and return all non blocking Handles which exist in the Selector. |
void |
select()
Wait an unlimited time until any of the registered Handles becomes non blocking. |
void |
select(long timeout)
Wait a limited time until any of the registered Handles becomes non blocking. |
int |
size()
The total number of Handles registered with the Selector. |
Method Detail |
public void addHandle(Handle hdl)
Register a sending or receiving Handle with the Selector. Reregistering an Handle has no effect. Registration can take place when selects are ongoing.
Registration may not cause indeterminacy in the results of getAllHandles(), size() getNonBlockingHandles or getBlockingHandles. This requires addHandle, removeHandle and clear to be synchronized with respect to the other methods.
hdl
- the Handle.public void removeHandle(Handle hdl)
Unregister a sending or receiving Handle with the Selector. Unregistering an Handle which is not registered has no effect. Unregistration can take place when selects are ongoing.
Unregistration may not cause indeterminacy in the results of getAllHandles(), size() getNonBlockingHandles or getBlockingHandles. This requires addHandle, removeHandle and clear to be synchronized with respect to the other methods.
hdl
- the Handle.public void select()
public void select(long timeout)
timeout
- the maximum wait time in milliseconds.public java.util.Vector getNonBlockingHandles()
public java.util.Vector getBlockingHandles()
public java.util.Vector getAllHandles()
public java.util.Vector removeNonBlockingHandles()
public Handle removeNonBlockingHandle()
public java.util.Vector removeBlockingHandles()
public Handle removeBlockingHandle()
public void clear()
Remove all registered Handles.
Unregistration may not cause indeterminacy in the results of getAllHandles(), size() getNonBlockingHandles or getBlockingHandles. This requires addHandle, removeHandle and clear to be synchronized with respect to the other methods.
public int size()
|
Jumpi v1.2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |