|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TransactionSelector<K extends TransactionSelectionKey>
A TransactionSelector can be compared to the java.nio.channels.Selector. It makes it possible that
multiple blocking transactions share the same executing thread. The advantage is that because no thread per
blocking transaction is needed, the number of threads is reduced. In theory you could have millions of blocking
transactions being executed by a few hundred threads. Of course the advantage of using this approach depends on
the amount of blocking done.
| Method Summary | |
|---|---|
void |
close()
|
void |
register(K key)
Registers a NonBlockingTaskContext to this TransactionSelector so that it No guarantees are made of the same NonBlockingTaskContext is registered while it already is registered (and not been returned with a select). |
K |
select()
Selects a NonBlockingTaskContext ready for execution or wait until a task comes available. |
K |
selectNow()
Selects a key to use or null if none available. |
| Method Detail |
|---|
void register(K key)
key -
java.lang.NullPointerException - if key is null.
K select()
throws java.lang.InterruptedException
java.lang.InterruptedException - if the thread is interrupted while waiting for a task to come available.K selectNow()
void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||