
com.evento.common.modeling.annotations.component.Projector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of evento-common Show documentation
Show all versions of evento-common Show documentation
Common Library of Object and Algorithms for Evento Framework
The newest version!
package com.evento.common.modeling.annotations.component;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* The Projector annotation is a marker annotation that designates a class as a projector.
* Projectors are responsible for handling events and updating the projection state.
* This annotation is used in conjunction with other annotations such as {@link Service}, {@link Observer},
* {@link Saga}, {@link Projection}, and {@link Invoker} to categorize and identify various roles or
* characteristics of classes within a software system.
*
*
* Example usage:
*
*
*
* {@code
* @Projector(version = 1, context = {Context.ALL})
* public class DemoProjector {
*
* @EventHandler
* public void on(DemoCreatedEvent event) {
* // Handle event logic
* }
*
* @EventHandler
* public void on(DemoUpdatedEvent event) {
* // Handle event logic
* }
* }
* }
*
*
* @see Service
* @see Observer
* @see Saga
* @see Projection
* @see Invoker
* @see com.evento.common.modeling.annotations.handler.EventHandler
* @see Projector in RECQ Component Patterns
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Component
public @interface Projector {
/**
* Returns the version of the Projector.
*
* @return the version of the Projector
*/
int version();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy