Package io.micronaut.data.runtime.event
Class EntityEventRegistry
java.lang.Object
io.micronaut.data.runtime.event.EntityEventRegistry
- All Implemented Interfaces:
- io.micronaut.context.processor.AnnotationProcessor<EntityEventMapping,,- io.micronaut.inject.ExecutableMethod<?, - ?>> - io.micronaut.context.processor.ExecutableMethodProcessor<EntityEventMapping>,- io.micronaut.core.order.Ordered,- EntityEventListener<Object>,- EventListener
@Singleton
@Primary
public class EntityEventRegistry
extends Object
implements EntityEventListener<Object>, io.micronaut.context.processor.ExecutableMethodProcessor<EntityEventMapping>
Primary implementation of the 
EntityEventListener interface that aggregates all other listeners.- Since:
- 2.3.0
- Author:
- graemerocher
- 
Field SummaryFieldsFields inherited from interface io.micronaut.data.event.EntityEventListenerNOOPFields inherited from interface io.micronaut.core.order.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionEntityEventRegistry(io.micronaut.context.BeanContext beanContext) Default constructor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidpostLoad(@NonNull EntityEventContext<Object> context) A post-load hook.voidpostPersist(@NonNull EntityEventContext<Object> context) A post-persist hook.voidpostRemove(@NonNull EntityEventContext<Object> context) A post-remove hook.voidpostUpdate(@NonNull EntityEventContext<Object> context) A post-update hook.booleanprePersist(@NonNull EntityEventContext<Object> context) A pre-persist hook.booleanpreRemove(@NonNull EntityEventContext<Object> context) A pre-remove hook.booleanpreUpdate(@NonNull EntityEventContext<Object> context) A pre-update hook.voidprocess(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) booleansupports(RuntimePersistentEntity<Object> entity, Class<? extends Annotation> eventType) Allows including or excluding a listener for a specific entity.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.data.event.EntityEventListenerpreQueryMethods inherited from interface io.micronaut.core.order.OrderedgetOrder
- 
Field Details- 
EVENT_TYPES
 
- 
- 
Constructor Details- 
EntityEventRegistrypublic EntityEventRegistry(io.micronaut.context.BeanContext beanContext) Default constructor.- Parameters:
- beanContext- The bean context
 
 
- 
- 
Method Details- 
supportspublic boolean supports(RuntimePersistentEntity<Object> entity, Class<? extends Annotation> eventType) Description copied from interface:EntityEventListenerAllows including or excluding a listener for a specific entity.- Specified by:
- supportsin interface- EntityEventListener<Object>
- Parameters:
- entity- The entity
- eventType- The event type
- Returns:
- True if it is supported
 
- 
prePersistDescription copied from interface:EntityEventListenerA pre-persist hook. Implementors can return false to evict the operation.- Specified by:
- prePersistin interface- EntityEventListener<Object>
- Parameters:
- context- The context object
- Returns:
- A boolean value indicating whether to proceed with the operation.
 
- 
postPersistDescription copied from interface:EntityEventListenerA post-persist hook. Executed once the object has been persisted.- Specified by:
- postPersistin interface- EntityEventListener<Object>
- Parameters:
- context- The context object
 
- 
postLoadDescription copied from interface:EntityEventListenerA post-load hook. Executed once the object has been persisted.- Specified by:
- postLoadin interface- EntityEventListener<Object>
- Parameters:
- context- The context object
 
- 
preRemoveDescription copied from interface:EntityEventListenerA pre-remove hook. Implementors can return false to evict the operation.- Specified by:
- preRemovein interface- EntityEventListener<Object>
- Parameters:
- context- The context object
- Returns:
- A boolean value indicating whether to proceed with the operation.
 
- 
postRemoveDescription copied from interface:EntityEventListenerA post-remove hook. Executed once the object has been removed.- Specified by:
- postRemovein interface- EntityEventListener<Object>
- Parameters:
- context- The context object
 
- 
preUpdateDescription copied from interface:EntityEventListenerA pre-update hook. Implementors can return false to evict the operation.- Specified by:
- preUpdatein interface- EntityEventListener<Object>
- Parameters:
- context- The context object
- Returns:
- A boolean value indicating whether to proceed with the operation.
 
- 
postUpdateDescription copied from interface:EntityEventListenerA post-update hook. Executed once the object has been updated.- Specified by:
- postUpdatein interface- EntityEventListener<Object>
- Parameters:
- context- The context object
 
- 
processpublic void process(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) - Specified by:
- processin interface- io.micronaut.context.processor.AnnotationProcessor<EntityEventMapping,- io.micronaut.inject.ExecutableMethod<?, - ?>> 
- Specified by:
- processin interface- io.micronaut.context.processor.ExecutableMethodProcessor<EntityEventMapping>
 
 
-