T - specific type of MembershipEvent.public abstract class MembershipEvent<T extends MembershipEvent<T>>
extends java.util.EventObject
EventObject implementation indicating a membership event in the DistributedSystem.EventObject,
Cache,
DistributedMember,
DistributedSystem,
DistributionManager,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
MembershipEvent.Type
An
enumeration of different type of MembershipEvents. |
| Constructor and Description |
|---|
MembershipEvent(org.apache.geode.distributed.internal.DistributionManager distributionManager)
Constructs a new instance of
MembershipEvent initialized with the given DistributionManager. |
| Modifier and Type | Method and Description |
|---|---|
protected static <T> T |
assertNotNull(T target,
java.lang.String message,
java.lang.Object... arguments)
Asserts that the given
target is not null. |
java.util.Optional<org.apache.geode.cache.Cache> |
getCache()
Returns an
Optional reference to the peer Cache. |
java.util.Optional<org.apache.geode.distributed.DistributedMember> |
getDistributedMember()
|
java.util.Optional<org.apache.geode.distributed.DistributedSystem> |
getDistributedSystem()
Returns an
Optional reference to the DistributedSystem (cluster) to which the peer
Cache is connected. |
org.apache.geode.distributed.internal.DistributionManager |
getDistributionManager()
Returns a reference to the configured
DistributionManager which is use as the source
of this event. |
MembershipEvent.Type |
getType()
Returns the
MembershipEvent.Type of this MembershipEvent, such as MembershipEvent.Type.MEMBER_JOINED. |
T |
withMember(org.apache.geode.distributed.DistributedMember distributedMember)
Null-safe builder method used to configure the
member that is the subject
of this event. |
public MembershipEvent(org.apache.geode.distributed.internal.DistributionManager distributionManager)
MembershipEvent initialized with the given DistributionManager.distributionManager - DistributionManager used to acquire the Cache, which is used
as the source of this event.java.lang.IllegalArgumentException - if DistributionManager is null.DistributionManagerprotected static <T> T assertNotNull(T target,
java.lang.String message,
java.lang.Object... arguments)
target is not null.T - type of the target.target - Object to evaluate.message - String containing the message for the IllegalArgumentException.arguments - array of arguments to populate the placeholders in the message.target.java.lang.IllegalArgumentException - if target is null.public java.util.Optional<org.apache.geode.cache.Cache> getCache()
Optional reference to the peer Cache.Optional reference to the peer Cache.Cache,
getDistributionManager(),
Optionalpublic java.util.Optional<org.apache.geode.distributed.DistributedMember> getDistributedMember()
Optional reference to the DistributedMember that is the subject of this event.DistributedMember,
getDistributionManager(),
Optionalpublic java.util.Optional<org.apache.geode.distributed.DistributedSystem> getDistributedSystem()
Optional reference to the DistributedSystem (cluster) to which the peer
Cache is connected.Optional reference to the DistributedSystem.DistributedSystem,
getDistributionManager(),
Optionalpublic org.apache.geode.distributed.internal.DistributionManager getDistributionManager()
DistributionManager which is use as the source
of this event.DistributionManager.DistributionManagerpublic MembershipEvent.Type getType()
MembershipEvent.Type of this MembershipEvent, such as MembershipEvent.Type.MEMBER_JOINED.MembershipEvent.Type.public T withMember(org.apache.geode.distributed.DistributedMember distributedMember)
member that is the subject
of this event.distributedMember - DistributedMember that is the subject of this event.MembershipEvent.DistributedMember,
getDistributedMember()