Class IntegrationEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.integration.events.IntegrationEvent
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
MessageGroupExpiredEvent
public abstract class IntegrationEvent
extends org.springframework.context.ApplicationEvent
Base class for all
ApplicationEvent
s generated by the framework.
Contains an optional cause field; a separate Exception event hierarchy
is not possible because of Java single inheritance (modules should make
all their events subclasses of 'xxxIntegrationEvent').- Since:
- 3.0
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Throwable
cause
-
Constructor Summary
Constructors Constructor Description IntegrationEvent(java.lang.Object source)
IntegrationEvent(java.lang.Object source, java.lang.Throwable cause)
-
Method Summary
Modifier and Type Method Description java.lang.Throwable
getCause()
<T> T
getSourceAsType()
Get the source as a specific type; the receiving variable must be declared with the correct type.java.lang.String
toString()
-
Field Details
-
cause
protected final java.lang.Throwable cause
-
-
Constructor Details
-
IntegrationEvent
public IntegrationEvent(java.lang.Object source) -
IntegrationEvent
public IntegrationEvent(java.lang.Object source, @Nullable java.lang.Throwable cause)
-
-
Method Details
-
getCause
public java.lang.Throwable getCause() -
getSourceAsType
public <T> T getSourceAsType()Get the source as a specific type; the receiving variable must be declared with the correct type.- Type Parameters:
T
- the type.- Returns:
- the source.
- Since:
- 5.4
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.util.EventObject
-