cleanup()
for releasing selectors.
| Modifier and Type | Field and Description |
|---|---|
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private static void | |
| public Selector | |
| public Selector | Returns: a java.nio.channels.SelectorGet a selector from the pool (or create a new one). |
| public void | |
| private Selector | |
| private void |
| pool | back to summary |
|---|---|
| private final Map<SelectorProvider, Queue<Selector>> pool | |
| SelectorPool | back to summary |
|---|---|
| public SelectorPool() | |
| cleanup | back to summary |
|---|---|
| public void cleanup() Clean up a pool. All selectors in a pool are closed and the pool gets empty. | |
| clearProviderPool | back to summary |
|---|---|
| private static void clearProviderPool(SelectorProvider provider, Queue<Selector> providerPool) | |
| get | back to summary |
|---|---|
| public Selector get() throws IOException Get a selector from the pool (or create a new one). Selectors come from the default selector provider on the current JVM.
| |
| get | back to summary |
|---|---|
| public Selector get(SelectorProvider provider) throws IOException Get a selector from the pool (or create a new one). Selectors come from the given provider.
| |
| put | back to summary |
|---|---|
| public void put(Selector selector) Put a selector back into the pool.
| |
| retrieveFromPool | back to summary |
|---|---|
| private Selector retrieveFromPool(SelectorProvider provider) throws IOException | |
| returnToPool | back to summary |
|---|---|
| private void returnToPool(Selector selector) | |