Class AbstractLeaderEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.integration.leader.event.AbstractLeaderEvent
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
OnFailedToAcquireMutexEvent
,OnGrantedEvent
,OnRevokedEvent
public abstract class AbstractLeaderEvent
extends org.springframework.context.ApplicationEvent
Base
ApplicationEvent
class for leader based events. All custom event
classes should be derived from this class.- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AbstractLeaderEvent(java.lang.Object source)
Create a new ApplicationEvent.AbstractLeaderEvent(java.lang.Object source, Context context, java.lang.String role)
Create a new ApplicationEvent. -
Method Summary
Modifier and Type Method Description Context
getContext()
Get theContext
associated with this event.java.lang.String
getRole()
Get the role of the leader.java.lang.String
toString()
-
Constructor Details
-
AbstractLeaderEvent
public AbstractLeaderEvent(java.lang.Object source)Create a new ApplicationEvent.- Parameters:
source
- the component that published the event (nevernull
)
-
AbstractLeaderEvent
Create a new ApplicationEvent.- Parameters:
source
- the component that published the event (nevernull
)context
- the context associated with this eventrole
- the role of the leader
-
-
Method Details
-
getContext
Get theContext
associated with this event.- Returns:
- the context
-
getRole
public java.lang.String getRole()Get the role of the leader.- Returns:
- the role
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.util.EventObject
-