Package com.tangosol.net
Class MemberEvent
java.lang.Object
java.util.EventObject
com.tangosol.net.MemberEvent
- All Implemented Interfaces:
Serializable
An event which indicates that membership has changed:
- a Member has joined
- a Member is leaving
- a Member has left
- Author:
- cp 2002.12.12
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
This event indicates that a Member has joined.static final int
This event indicates that a Member is leaving.static final int
This event indicates that a Member has left.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionMemberEvent
(Object oSource, int nId, Member member) Constructs a new MemberEvent. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Dispatch this event to the specified listeners collection.void
dispatch
(EventListener[] aListeners) Dispatch this event to the specified array of listeners.int
getId()
Return this event's id.Return the Member associated with this event.Return the Service that fired the eventboolean
isLocal()
Check whether a Member object for this event represents the local member of the cluster.toString()
Returns a String representation of this MemberEvent object.Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
MEMBER_JOINED
public static final int MEMBER_JOINEDThis event indicates that a Member has joined.- See Also:
-
MEMBER_LEAVING
public static final int MEMBER_LEAVINGThis event indicates that a Member is leaving.- See Also:
-
MEMBER_LEFT
public static final int MEMBER_LEFTThis event indicates that a Member has left.- See Also:
-
-
Constructor Details
-
MemberEvent
Constructs a new MemberEvent.- Parameters:
oSource
- the source object that fired the event (a Service)nId
- this event's idmember
- the Member for which the event applies
-
-
Method Details
-
getId
public int getId()Return this event's id.- Returns:
- the event ID, one of
-
getMember
Return the Member associated with this event.- Returns:
- the Member
-
getService
Return the Service that fired the event- Returns:
- the Service
-
dispatch
Dispatch this event to the specified listeners collection.- Parameters:
listeners
- the listeners collection- Throws:
ClassCastException
- if any of the targets is not an instance of MemberListener interface
-
dispatch
Dispatch this event to the specified array of listeners.- Parameters:
aListeners
- the array of listeners- Throws:
ClassCastException
- if any of the targets is not an instance of MemberListener interface
-
isLocal
public boolean isLocal()Check whether a Member object for this event represents the local member of the cluster.- Returns:
- true iff the event's Member object represents the local cluster member
-
toString
Returns a String representation of this MemberEvent object.- Overrides:
toString
in classEventObject
- Returns:
- a String representation of this MemberEvent object.
-