Class MembershipEvent<T extends MembershipEvent<T>>
java.lang.Object
java.util.EventObject
org.springframework.geode.distributed.event.MembershipEvent<T>
- Type Parameters:
T
- specifictype
ofMembershipEvent
.
- 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:
-
EventObject
Cache
DistributedMember
DistributedSystem
DistributionManager
- Serialized Form
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Anenumeration
of different type ofMembershipEvents
. -
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionMembershipEvent
(org.apache.geode.distributed.internal.DistributionManager distributionManager) Constructs a new instance ofMembershipEvent
initialized with the givenDistributionManager
. -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> T
assertNotNull
(T target, String message, Object... arguments) Asserts that the giventarget
is not null.Optional<org.apache.geode.cache.Cache>
getCache()
Returns anOptional
reference to the peerCache
.Optional<org.apache.geode.distributed.DistributedMember>
Optional<org.apache.geode.distributed.DistributedSystem>
Returns anOptional
reference to theDistributedSystem
(cluster) to which the peerCache
is connected.org.apache.geode.distributed.internal.DistributionManager
Returns a reference to the configuredDistributionManager
which is use as thesource
of this event.getType()
Returns theMembershipEvent.Type
of thisMembershipEvent
, such asMembershipEvent.Type.MEMBER_JOINED
.withMember
(org.apache.geode.distributed.DistributedMember distributedMember) Null-safe builder method used to configure themember
that 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 ofMembershipEvent
initialized with the givenDistributionManager
.- Parameters:
distributionManager
-DistributionManager
used to acquire theCache
, which is used as the source of this event.- Throws:
IllegalArgumentException
- ifDistributionManager
is null.- See Also:
-
DistributionManager
-
-
Method Details
-
assertNotNull
Asserts that the giventarget
is not null.- Type Parameters:
T
-type
of thetarget
.- Parameters:
target
-Object
to evaluate.message
-String
containing the message for theIllegalArgumentException
.arguments
- array ofarguments
to populate the placeholders in themessage
.- Returns:
- the
target
. - Throws:
IllegalArgumentException
- iftarget
is null.
-
getCache
Returns anOptional
reference to the peerCache
.- Returns:
- an
Optional
reference to the peerCache
. - See Also:
-
getDistributedMember
- Returns:
- an
Optional
reference to theDistributedMember
that is the subject of this event. - See Also:
-
DistributedMember
getDistributionManager()
Optional
-
getDistributedSystem
Returns anOptional
reference to theDistributedSystem
(cluster) to which the peerCache
is connected.- Returns:
- an
Optional
reference to theDistributedSystem
. - See Also:
-
DistributedSystem
getDistributionManager()
Optional
-
getDistributionManager
public org.apache.geode.distributed.internal.DistributionManager getDistributionManager()Returns a reference to the configuredDistributionManager
which is use as thesource
of this event.- Returns:
- a reference to the
DistributionManager
. - See Also:
-
DistributionManager
-
getType
Returns theMembershipEvent.Type
of thisMembershipEvent
, such asMembershipEvent.Type.MEMBER_JOINED
.- Returns:
- the
MembershipEvent.Type
.
-
withMember
Null-safe builder method used to configure themember
that is the subject of this event.- Parameters:
distributedMember
-DistributedMember
that is the subject of this event.- Returns:
- this
MembershipEvent
. - See Also:
-
DistributedMember
getDistributedMember()
-