public static class QuartzEventScheduler.DirectEventJobDataBinder extends Object implements EventJobDataBinder
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.
Modifier and Type | Field and Description |
---|---|
static String |
EVENT_KEY
Deprecated.
in favor of the default message keys | only maintained for backwards compatibility
|
Constructor and Description |
---|
DirectEventJobDataBinder()
Deprecated.
in favor of
DirectEventJobDataBinder(Serializer) , as the Serializer is a hard requirement. |
DirectEventJobDataBinder(Serializer serializer)
Instantiate a
QuartzEventScheduler.DirectEventJobDataBinder with the provided Serializer for
de-/serializing event messages. |
Modifier and Type | Method and Description |
---|---|
Object |
fromJobData(org.quartz.JobDataMap jobDataMap)
Note that this function is able to retrieve an Event Message in two formats.
|
org.quartz.JobDataMap |
toJobData(Object event)
Write an
eventMessage (or its payload) to a JobDataMap . |
@Deprecated public static final String EVENT_KEY
JobDataMap
.@Deprecated public DirectEventJobDataBinder()
DirectEventJobDataBinder(Serializer)
, as the Serializer
is a hard requirement.QuartzEventScheduler.DirectEventJobDataBinder
which defaults to a XStreamSerializer
for
de-/serializing event messages.public DirectEventJobDataBinder(Serializer serializer)
QuartzEventScheduler.DirectEventJobDataBinder
with the provided Serializer
for
de-/serializing event messages.serializer
- the Serializer
used for de-/serializing event messagespublic org.quartz.JobDataMap toJobData(Object event)
EventJobDataBinder
eventMessage
(or its payload) to a JobDataMap
.toJobData
in interface EventJobDataBinder
event
- to write to the JobDataMap
JobDataMap
written to (must not be null)public Object fromJobData(org.quartz.JobDataMap jobDataMap)
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
.
fromJobData
in interface EventJobDataBinder
jobDataMap
- to read fromCopyright © 2010–2024. All rights reserved.