org.apache.cayenne.event

## Class CayenneEvent

- java.lang.Object
- - java.util.EventObject
  - - org.apache.cayenne.event.CayenneEvent

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    GraphEvent, MapEvent, SnapshotEvent

      public class CayenneEvent
      extends EventObject

  Common superclass for events passed from the EventManager to Listeners; encapsulates optional event information.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map` | `info`
    `protected Object` | `postedBy`
    `protected EventSubject` | `subject`

    - ### Fields inherited from class java.util.EventObject

      `source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CayenneEvent(Object source)`
    `CayenneEvent(Object source, Map info)`
    `CayenneEvent(Object source, Object postedBy, Map info)` Creates CayenneEvent with possibly different event source and poster.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map` | `getInfo()`
    `Object` | `getPostedBy()` Returns an object that posted this event.
    `EventSubject` | `getSubject()`
    `void` | `setPostedBy(Object postedBy)`
    `void` | `setSubject(EventSubject subject)`

    - ### Methods inherited from class java.util.EventObject

      `getSource, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### info

          protected Map info

    - #### postedBy

          protected transient Object postedBy

    - #### subject

          protected EventSubject subject

  - ### Constructor Detail

    - #### CayenneEvent

          public CayenneEvent(Object source)

    - #### CayenneEvent

          public CayenneEvent(Object source,
                              Map info)

    - #### CayenneEvent

          public CayenneEvent(Object source,
                              Object postedBy,
                              Map info)

      Creates CayenneEvent with possibly different event source and poster. This may be the case when an event is resent by listener.
      Since:
        1.1

  - ### Method Detail

    - #### getInfo

          public Map getInfo()

    - #### getSubject

          public EventSubject getSubject()

      Since:
        1.2

    - #### setSubject

          public void setSubject(EventSubject subject)

      Since:
        1.2

    - #### getPostedBy

          public Object getPostedBy()

      Returns an object that posted this event. It may be different from event source, if event is reposted multiple times.

    - #### setPostedBy

          public void setPostedBy(Object postedBy)

Copyright © 2001–2021 Apache Cayenne. All rights reserved.