public interface BinaryStarReactor
Modifier and Type | Interface and Description |
---|---|
static class |
BinaryStarReactor.Event
Events, which start with the states our peer can be in.
|
static class |
BinaryStarReactor.Mode
Startup modes.
|
static class |
BinaryStarReactor.State
States we can be in at any point in time.
|
Modifier and Type | Field and Description |
---|---|
static long |
BSTAR_HEARTBEAT
We send state information this often.
|
Modifier and Type | Method and Description |
---|---|
Reactor |
getReactor()
Get the underlying
Reactor . |
void |
registerVoterSocket(Socket socket)
Register a client voter socket.
|
void |
setActiveHandler(LoopHandler handler)
Register a handler to be called each time there's a state change.
|
void |
setHeartbeatInterval(long heartbeatInterval)
Set the heartbeat interval used to detect peer outage.
|
void |
setPassiveHandler(LoopHandler handler)
Register a handler to be called each time there's a state change.
|
void |
setVoterHandler(LoopHandler handler)
Register a voter handler to be called each time the application receives a message.
|
void |
start()
Start the underlying Reactor.
|
void |
stop()
Stop the underlying Reactor.
|
static final long BSTAR_HEARTBEAT
void start()
void stop()
void registerVoterSocket(Socket socket)
socket
- The client socketvoid setVoterHandler(LoopHandler handler)
handler
- The handler for client eventsvoid setActiveHandler(LoopHandler handler)
handler
- The handler for state change eventsvoid setPassiveHandler(LoopHandler handler)
handler
- The handler for state change eventsvoid setHeartbeatInterval(long heartbeatInterval)
heartbeatInterval
- The heartbeat interval, in millisecondsCopyright © 2019. All rights reserved.