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 ApplicationEvents 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  

    Fields inherited from class java.util.EventObject

    source
  • 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()  

    Methods inherited from class org.springframework.context.ApplicationEvent

    getTimestamp

    Methods inherited from class java.util.EventObject

    getSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 class java.util.EventObject