@ThreadSafe public abstract class AbstractPrimarySelector extends Object implements PrimarySelector
#setState(State)
when they detect a state change. The selector starts off in STANDBY
state.PrimarySelector.Factory, PrimarySelector.State
Constructor and Description |
---|
AbstractPrimarySelector() |
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.
|
protected void |
setState(PrimarySelector.State state) |
void |
waitForState(PrimarySelector.State state)
Blocks until the primary selector enters the specified state.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
start, stop
protected final void setState(PrimarySelector.State state)
public final PrimarySelector.State getState()
getState
in interface PrimarySelector
public final Scoped onStateChange(java.util.function.Consumer<PrimarySelector.State> listener)
PrimarySelector
onStateChange
in interface PrimarySelector
listener
- the listenerpublic final void waitForState(PrimarySelector.State state) throws InterruptedException
PrimarySelector
waitForState
in interface PrimarySelector
state
- the state to wait forInterruptedException
Copyright © 2023. All Rights Reserved.