Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (c) 2011. Axon Framework
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.axonframework.eventhandling;

Interface to a policy definition for concurrent processing, for example event handling.

Some implementations are provided by default:

  • SequentialPolicy: Default policy. Requires that all tasks are handled in the order they arrive at the processor. This also means that at most 1 thread is processing tasks for this processor at any time.
  • FullConcurrencyPolicy: Allows each tasks to be handled independently of any other tasks. Tasks processing will typically start in the same order the tasks were scheduled in.
  • SequentialPerAggregatePolicy: Will force events (only supports Event Handling tasks) generated by the same aggregate to be handled sequentially. At most one thread will be processing events of a single aggregate at any time

<T> The type of object representing the processing instruction for the event.
Allard Buijze
public interface SequencingPolicy<T> {

Returns the sequence identifier for the given event. When two events have the same identifier (as defined by their equals method), they will be executed sequentially. A null value indicates that there are no sequencing requirements for the handling of this event.

event the event for which to get the sequencing identifier
a sequence identifier for the given event
New to GrepCode? Check out our FAQ X