Spring Boot for VMware GemFire
Class MembershipEvent<T extends MembershipEvent<T>>
java.lang.Object
java.util.EventObject
org.springframework.geode.distributed.event.MembershipEvent<T>
- Type Parameters:
T- specifictypeofMembershipEvent.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MemberDepartedEvent,MemberJoinedEvent,MemberSuspectEvent,QuorumLostEvent
EventObject implementation indicating a membership event in the DistributedSystem.- Since:
- 1.3.0
- See Also:
-
EventObjectCacheDistributedMemberDistributedSystemDistributionManager- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAnenumerationof different type ofMembershipEvents. -
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionMembershipEvent(org.apache.geode.distributed.internal.DistributionManager distributionManager) Constructs a new instance ofMembershipEventinitialized with the givenDistributionManager. -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> TassertNotNull(T target, String message, Object... arguments) Asserts that the giventargetis not null.Optional<org.apache.geode.cache.Cache>getCache()Returns anOptionalreference to the peerCache.Optional<org.apache.geode.distributed.DistributedMember>Optional<org.apache.geode.distributed.DistributedSystem>Returns anOptionalreference to theDistributedSystem(cluster) to which the peerCacheis connected.org.apache.geode.distributed.internal.DistributionManagerReturns a reference to the configuredDistributionManagerwhich is use as thesourceof this event.getType()Returns theMembershipEvent.Typeof thisMembershipEvent, such asMembershipEvent.Type.MEMBER_JOINED.withMember(org.apache.geode.distributed.DistributedMember distributedMember) Null-safe builder method used to configure thememberthat is the subject of this event.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
MembershipEvent
public MembershipEvent(org.apache.geode.distributed.internal.DistributionManager distributionManager) Constructs a new instance ofMembershipEventinitialized with the givenDistributionManager.- Parameters:
distributionManager-DistributionManagerused to acquire theCache, which is used as the source of this event.- Throws:
IllegalArgumentException- ifDistributionManageris null.- See Also:
-
DistributionManager
-
-
Method Details
-
assertNotNull
Asserts that the giventargetis not null.- Type Parameters:
T-typeof thetarget.- Parameters:
target-Objectto evaluate.message-Stringcontaining the message for theIllegalArgumentException.arguments- array ofargumentsto populate the placeholders in themessage.- Returns:
- the
target. - Throws:
IllegalArgumentException- iftargetis null.
-
getCache
Returns anOptionalreference to the peerCache.- Returns:
- an
Optionalreference to the peerCache. - See Also:
-
getDistributedMember
- Returns:
- an
Optionalreference to theDistributedMemberthat is the subject of this event. - See Also:
-
DistributedMembergetDistributionManager()Optional
-
getDistributedSystem
Returns anOptionalreference to theDistributedSystem(cluster) to which the peerCacheis connected.- Returns:
- an
Optionalreference to theDistributedSystem. - See Also:
-
DistributedSystemgetDistributionManager()Optional
-
getDistributionManager
public org.apache.geode.distributed.internal.DistributionManager getDistributionManager()Returns a reference to the configuredDistributionManagerwhich is use as thesourceof this event.- Returns:
- a reference to the
DistributionManager. - See Also:
-
DistributionManager
-
getType
Returns theMembershipEvent.Typeof thisMembershipEvent, such asMembershipEvent.Type.MEMBER_JOINED.- Returns:
- the
MembershipEvent.Type.
-
withMember
Null-safe builder method used to configure thememberthat is the subject of this event.- Parameters:
distributedMember-DistributedMemberthat is the subject of this event.- Returns:
- this
MembershipEvent. - See Also:
-
DistributedMembergetDistributedMember()
-