@NoImplement public interface CoreEvent extends Serializable, Event
Holds a Message payload and provides helper methods for obtaining the data in a format that the receiving Mule component understands. The event can also maintain any number of properties that can be set and retrieved by Mule components.
Message
Modifier and Type | Interface and Description |
---|---|
static interface |
CoreEvent.Builder |
Modifier and Type | Method and Description |
---|---|
static CoreEvent.Builder |
builder(CoreEvent event)
Create new
CoreEvent.Builder based on an existing CoreEvent instance. |
static CoreEvent.Builder |
builder(EventContext context)
Create new
CoreEvent.Builder . |
static CoreEvent.Builder |
builder(EventContext context,
CoreEvent event)
|
FlowCallStack |
getFlowCallStack()
Events have a stack of executed flows (same as a call stack), so that at any given instant an application developer can
determine where this event came from.
|
Optional<GroupCorrelation> |
getGroupCorrelation()
Deprecated.
use
Event.getItemSequenceInfo() instead |
SecurityContext |
getSecurityContext()
The security context for this session.
|
static <T> T |
getVariableValueOrNull(String key,
CoreEvent event)
Helper method to get the value of a given variable in a null-safe manner such that
null is returned for non-existent
variables rather than a NoSuchElementException exception being thrown. |
asBindingContext, getAuthentication, getContext, getCorrelationId, getError, getItemSequenceInfo, getMessage, getVariables
SecurityContext getSecurityContext()
Optional<GroupCorrelation> getGroupCorrelation()
Event.getItemSequenceInfo()
insteadGroupCorrelation
.FlowCallStack getFlowCallStack()
This will only be enabled if DefaultMuleConfiguration#isFlowTrace()
is true
. If false
, the stack will
always be empty.
static CoreEvent.Builder builder(EventContext context)
CoreEvent.Builder
.context
- the context to create event instance with.static CoreEvent.Builder builder(CoreEvent event)
CoreEvent.Builder
based on an existing CoreEvent
instance. The existing EventContext
is
conserved.event
- existing event to use as a template to create builder instancestatic CoreEvent.Builder builder(EventContext context, CoreEvent event)
CoreEvent.Builder
based on an existing CoreEvent
instance and and EventContext
. A new
EventContext
is used instead of the existing instance referenced by the existing CoreEvent
. This builder
should only be used in some specific scenarios like flow-ref
where a new Flow executing the same
CoreEvent
needs a new context.event
- existing event to use as a template to create builder instancecontext
- the context to create event instance with.static <T> T getVariableValueOrNull(String key, CoreEvent event)
null
is returned for non-existent
variables rather than a NoSuchElementException
exception being thrown.T
- the variable typekey
- the key of the variable to retrieve.event
- the event from which to retrieve a variable with the given key.null
.Copyright © 2018. All rights reserved.