public class ApplicationContextMembershipListener extends org.springframework.geode.distributed.event.MembershipListenerAdapter<ApplicationContextMembershipListener>
ApplicationContextMembershipListener class is an extension of MembershipListenerAdapter used to
adapt the ConfigurableApplicationContext to handle and process membership events,
and specifically MemberDepartedEvent and MemberJoinedEvent, by
closing and refreshing
the ConfigurableApplicationContext when the peer member departs and joins the
cluster.DistributedMember,
DistributedSystem,
ConfigurableApplicationContext,
MemberDepartedEvent,
MemberJoinedEvent| Constructor and Description |
|---|
ApplicationContextMembershipListener(org.springframework.context.ConfigurableApplicationContext applicationContext)
Constructs a new instance of
ConfigurableApplicationContext initialized with
the given ConfigurableApplicationContext. |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.context.ConfigurableApplicationContext |
getApplicationContext()
Returns a reference to the configured
ConfigurableApplicationContext. |
void |
handleMemberDeparted(org.springframework.geode.distributed.event.support.MemberDepartedEvent event)
Handles the
membership event when a peer member
departs from the cluster by calling ConfigurableApplicationContext.close(). |
void |
handleMemberJoined(org.springframework.geode.distributed.event.support.MemberJoinedEvent event)
Handles the
membership event when a peer member
joins the cluster by calling ConfigurableApplicationContext.refresh(). |
public ApplicationContextMembershipListener(@NonNull
org.springframework.context.ConfigurableApplicationContext applicationContext)
ConfigurableApplicationContext initialized with
the given ConfigurableApplicationContext.applicationContext - configured ConfigurableApplicationContext; must not be null.java.lang.IllegalArgumentException - if ConfigurableApplicationContext is null.ConfigurableApplicationContext@NonNull protected org.springframework.context.ConfigurableApplicationContext getApplicationContext()
ConfigurableApplicationContext.ConfigurableApplicationContext.ConfigurableApplicationContextpublic void handleMemberDeparted(org.springframework.geode.distributed.event.support.MemberDepartedEvent event)
membership event when a peer member
departs from the cluster by calling ConfigurableApplicationContext.close().handleMemberDeparted in class org.springframework.geode.distributed.event.MembershipListenerAdapter<ApplicationContextMembershipListener>event - MemberDepartedEvent to handle.MemberDepartedEvent,
ConfigurableApplicationContext.close()public void handleMemberJoined(org.springframework.geode.distributed.event.support.MemberJoinedEvent event)
membership event when a peer member
joins the cluster by calling ConfigurableApplicationContext.refresh().handleMemberJoined in class org.springframework.geode.distributed.event.MembershipListenerAdapter<ApplicationContextMembershipListener>event - MemberJoinedEvent to handle.MemberJoinedEvent,
ConfigurableApplicationContext.refresh()