public class DefaultEventRouter extends Object implements EventRouter.Default
EventRouter.Default| Constructor and Description |
|---|
DefaultEventRouter(MessageLog.Appender appender,
EventApplier eventApplier) |
| Modifier and Type | Method and Description |
|---|---|
void |
complete() |
boolean |
isSkipped()
If true the current command was skipped without routing any events.
|
short |
nextEventIndex()
Returns the zero based index of the next event to be routed.
|
org.tools4j.elara.route.DefaultEventRouter.RoutingContext |
routingEvent(int type)
Starts routing of an event of the given
type returns the routing context with the buffer for event
encoding. |
boolean |
skipCommand()
Skip the current command if possible.
|
DefaultEventRouter |
start(Command command) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrouteEvent, routeEvent, routeEventWithoutPayload, routingEventpublic DefaultEventRouter(MessageLog.Appender appender, EventApplier eventApplier)
public DefaultEventRouter start(Command command)
public org.tools4j.elara.route.DefaultEventRouter.RoutingContext routingEvent(int type)
EventRoutertype returns the routing context with the buffer for event
encoding. Encoding and routing is completed with route(..) and is recommended
to be performed inside a try-resource block; see class documentation for an example.routingEvent in interface EventRoutertype - the event type, typically non-negative for application events (plugins use negative event types)public void complete()
public boolean skipCommand()
EventRouterskipCommand in interface EventRouterpublic boolean isSkipped()
EventRouterThe application state after processing the current command will be exactly the same as before the command. Note that the command will not be be marked as processed and is normally also not replayed. Replaying of the command may occur however if the application is restarted or leadership is passed to another node and commands are replayed from the command log. However replaying occurs only if no subsequent command from the same source has yet been marked as processed.
isSkipped in interface EventRouterpublic short nextEventIndex()
EventRouterEventRouter.routingEvent()
then the index refers to the event currently being encoded.nextEventIndex in interface EventRouterCopyright © 2020 tools4j.org (Marco Terzer, Anton Anufriev). All Rights Reserved.