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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.in favor ofDirectEventJobDataBinder(Serializer), as theSerializeris a hard requirement.DirectEventJobDataBinder(Serializer serializer) Instantiate aQuartzEventScheduler.DirectEventJobDataBinderwith the providedSerializerfor de-/serializing event messages. -
Method Summary
Modifier and TypeMethodDescriptionfromJobData(org.quartz.JobDataMap jobDataMap) Note that this function is able to retrieve an Event Message in two formats.org.quartz.JobDataMapWrite aneventMessage(or its payload) to aJobDataMap.
-
Field Details
-
EVENT_KEY
Deprecated.in favor of the default message keys | only maintained for backwards compatibilityThe key used to locate the event in theJobDataMap.
-
-
Constructor Details
-
DirectEventJobDataBinder
Deprecated.in favor ofDirectEventJobDataBinder(Serializer), as theSerializeris a hard requirement.Instantiate aQuartzEventScheduler.DirectEventJobDataBinderwhich defaults to aXStreamSerializerfor de-/serializing event messages. -
DirectEventJobDataBinder
Instantiate aQuartzEventScheduler.DirectEventJobDataBinderwith the providedSerializerfor de-/serializing event messages.- Parameters:
serializer- theSerializerused for de-/serializing event messages
-
-
Method Details
-
toJobData
Description copied from interface:EventJobDataBinderWrite aneventMessage(or its payload) to aJobDataMap.- Specified by:
toJobDatain interfaceEventJobDataBinder- Parameters:
event- to write to theJobDataMap- Returns:
JobDataMapwritten to (must not be null)
-
fromJobData
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 configurableSerializerin this class to serialized the payload and metadata of an event message. All fields which required to instantiate aGenericEventMessageare currently stored in thejobDataMapwhen calling thetoJobData(Object)function. Approach one only exists for backwards compatibility and should be removed in subsequent major releases.Read an
EventMessage(or its payload) from theJobDataMap.- Specified by:
fromJobDatain interfaceEventJobDataBinder- Parameters:
jobDataMap- to read from- Returns:
- event message (or its payload)
-