public interface PrimarySelector
Modifier and Type | Interface and Description |
---|---|
static class |
PrimarySelector.Factory
Factory for creating primary selectors.
|
static class |
PrimarySelector.State
The state for the primary selector.
|
Modifier and Type | Method and Description |
---|---|
PrimarySelector.State |
getState() |
Scoped |
onStateChange(java.util.function.Consumer<PrimarySelector.State> listener)
Registers a listener to be executed whenever the selector's state updates.
|
void |
start(InetSocketAddress localAddress)
Starts the primary selector.
|
void |
stop()
Stops the primary selector.
|
void |
waitForState(PrimarySelector.State state)
Blocks until the primary selector enters the specified state.
|
void start(InetSocketAddress localAddress) throws IOException
localAddress
- the address of the local masterIOException
void stop() throws IOException
IOException
PrimarySelector.State getState()
Scoped onStateChange(java.util.function.Consumer<PrimarySelector.State> listener)
listener
- the listenervoid waitForState(PrimarySelector.State state) throws InterruptedException
state
- the state to wait forInterruptedException
Copyright © 2023. All Rights Reserved.