public class LocalLeader
extends java.lang.Object
Constructor and Description |
---|
LocalLeader(GenieEventBus genieEventBus,
boolean isLeader)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
startLeadership(org.springframework.context.event.ContextRefreshedEvent event)
Event listener for when a context is started up.
|
void |
stopLeadership(org.springframework.context.event.ContextClosedEvent event)
Before the application shuts down need to turn off leadership activities.
|
public LocalLeader(GenieEventBus genieEventBus, boolean isLeader)
genieEventBus
- The spring application event publisher to use to invoke that this node is a leaderisLeader
- Whether this node should be the leader or not. Should only be one in a cluster but not
enforced by Genie at this time@EventListener public void startLeadership(org.springframework.context.event.ContextRefreshedEvent event)
event
- The Spring Boot application ready event to startup on@EventListener public void stopLeadership(org.springframework.context.event.ContextClosedEvent event)
event
- The application context closing event