Class QuartzEventScheduler.DirectEventJobDataBinder

java.lang.Object
org.axonframework.eventhandling.scheduling.quartz.QuartzEventScheduler.DirectEventJobDataBinder
All Implemented Interfaces:
EventJobDataBinder
Enclosing class:
QuartzEventScheduler

public static class QuartzEventScheduler.DirectEventJobDataBinder extends Object implements EventJobDataBinder
Binds an EventMessage to the JobDataMap by serializing the payload and metadata with a Serializer. All the important EventMessage fields, thus the message identifier, timestamp, and the serialized payload and metadata, are stored as separate values in the JobDataMap.

The old approach, which let Quartz do the serialization of the entire EventMessage at once, is maintained for backwards compatibility only.

  • Field Details

    • EVENT_KEY

      @Deprecated public static final String EVENT_KEY
      Deprecated.
      in favor of the default message keys | only maintained for backwards compatibility
      The key used to locate the event in the JobDataMap.
  • Constructor Details

  • Method Details

    • toJobData

      public org.quartz.JobDataMap toJobData(Object event)
      Description copied from interface: EventJobDataBinder
      Write an eventMessage (or its payload) to a JobDataMap.
      Specified by:
      toJobData in interface EventJobDataBinder
      Parameters:
      event - to write to the JobDataMap
      Returns:
      JobDataMap written to (must not be null)
    • fromJobData

      public Object fromJobData(org.quartz.JobDataMap jobDataMap)
      Note that this function is able to retrieve an Event Message in two formats. The first is the original, deprecated approach, which uses the Quartz serializer (read Java serialization) to serialize an entire event message at once. The second approach uses the configurable Serializer in this class to serialized the payload and metadata of an event message. All fields which required to instantiate a GenericEventMessage are currently stored in the jobDataMap when calling the toJobData(Object) function. Approach one only exists for backwards compatibility and should be removed in subsequent major releases.

      Read an EventMessage (or its payload) from the JobDataMap.

      Specified by:
      fromJobData in interface EventJobDataBinder
      Parameters:
      jobDataMap - to read from
      Returns:
      event message (or its payload)