Class ProcessingContextEventAppender
- All Implemented Interfaces:
DescribableComponent,EventAppender
EventSink in the context of a ProcessingContext. The events
will be published in the context this appender was created for. You can construct one through the
invalid reference
EventAppender#forContext(ProcessingContext, Configuration)
- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
-
Field Summary
Fields inherited from interface org.axonframework.messaging.eventhandling.gateway.EventAppender
RESOURCE_KEY -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend a collection of events to the event store in the currentProcessingContext.voiddescribeTo(ComponentDescriptor descriptor) Describe the properties ofthis DescribableComponentwith the givendescriptor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.eventhandling.gateway.EventAppender
append
-
Method Details
-
append
Description copied from interface:EventAppenderAppend a collection of events to the event store in the currentProcessingContext. The events will be published when the context commits.- Specified by:
appendin interfaceEventAppender- Parameters:
events- The collection of events to publish.
-
describeTo
Description copied from interface:DescribableComponentDescribe the properties ofthis DescribableComponentwith the givendescriptor.Components should call the appropriate
describePropertymethods on the descriptor to register their properties. The descriptor is responsible for determining how these properties are formatted and structured in the final output.Best Practices: As a general rule, all relevant fields of a
DescribableComponentimplementation should be described in this method. However, developers have discretion to include only the fields that make sense in the context. Not every field may be meaningful for description purposes, especially internal implementation details. Furthermore, components might want to expose different information based on their current state. The final decision on what properties to include lies with the person implementing thedescribeTomethod, who should focus on providing information that is useful for understanding the component's configuration and state.Example implementation:
public void describeTo(ComponentDescriptor descriptor) { descriptor.describeProperty("name", this.name); descriptor.describeProperty("enabled", this.enabled); descriptor.describeProperty("configuration", this.configuration); // A nested component descriptor.describeProperty("handlers", this.eventHandlers); // A collection }- Specified by:
describeToin interfaceDescribableComponent- Parameters:
descriptor- The component descriptor to describethis DescribableComponentn its properties in.
-