Class EntityEventRegistry

  • All Implemented Interfaces:
    io.micronaut.context.processor.AnnotationProcessor<io.micronaut.data.annotation.event.EntityEventMapping,​io.micronaut.inject.ExecutableMethod<?,​?>>, io.micronaut.context.processor.ExecutableMethodProcessor<io.micronaut.data.annotation.event.EntityEventMapping>, io.micronaut.core.order.Ordered, io.micronaut.data.event.EntityEventListener<java.lang.Object>, java.util.EventListener

    @Singleton
    @Primary
    public class EntityEventRegistry
    extends java.lang.Object
    implements io.micronaut.data.event.EntityEventListener<java.lang.Object>, io.micronaut.context.processor.ExecutableMethodProcessor<io.micronaut.data.annotation.event.EntityEventMapping>
    Primary implementation of the EntityEventListener interface that aggregates all other listeners.
    Since:
    2.3.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> EVENT_TYPES  
      • Fields inherited from interface io.micronaut.data.event.EntityEventListener

        NOOP
      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Summary

      Constructors 
      Constructor Description
      EntityEventRegistry​(io.micronaut.context.BeanContext beanContext)
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void postLoad​(io.micronaut.data.event.EntityEventContext<java.lang.Object> context)  
      void postPersist​(io.micronaut.data.event.EntityEventContext<java.lang.Object> context)  
      void postRemove​(io.micronaut.data.event.EntityEventContext<java.lang.Object> context)  
      void postUpdate​(io.micronaut.data.event.EntityEventContext<java.lang.Object> context)  
      boolean prePersist​(io.micronaut.data.event.EntityEventContext<java.lang.Object> context)  
      boolean preRemove​(io.micronaut.data.event.EntityEventContext<java.lang.Object> context)  
      boolean preUpdate​(io.micronaut.data.event.EntityEventContext<java.lang.Object> context)  
      void process​(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?,​?> method)  
      boolean supports​(io.micronaut.data.model.runtime.RuntimePersistentEntity<java.lang.Object> entity, java.lang.Class<? extends java.lang.annotation.Annotation> eventType)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.data.event.EntityEventListener

        preQuery
      • Methods inherited from interface io.micronaut.core.order.Ordered

        getOrder
    • Field Detail

      • EVENT_TYPES

        public static final java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> EVENT_TYPES
    • Constructor Detail

      • EntityEventRegistry

        public EntityEventRegistry​(io.micronaut.context.BeanContext beanContext)
        Default constructor.
        Parameters:
        beanContext - The bean context
    • Method Detail

      • supports

        public boolean supports​(io.micronaut.data.model.runtime.RuntimePersistentEntity<java.lang.Object> entity,
                                java.lang.Class<? extends java.lang.annotation.Annotation> eventType)
        Specified by:
        supports in interface io.micronaut.data.event.EntityEventListener<java.lang.Object>
      • prePersist

        public boolean prePersist​(@NonNull
                                  io.micronaut.data.event.EntityEventContext<java.lang.Object> context)
        Specified by:
        prePersist in interface io.micronaut.data.event.EntityEventListener<java.lang.Object>
      • postPersist

        public void postPersist​(@NonNull
                                io.micronaut.data.event.EntityEventContext<java.lang.Object> context)
        Specified by:
        postPersist in interface io.micronaut.data.event.EntityEventListener<java.lang.Object>
      • postLoad

        public void postLoad​(@NonNull
                             io.micronaut.data.event.EntityEventContext<java.lang.Object> context)
        Specified by:
        postLoad in interface io.micronaut.data.event.EntityEventListener<java.lang.Object>
      • preRemove

        public boolean preRemove​(@NonNull
                                 io.micronaut.data.event.EntityEventContext<java.lang.Object> context)
        Specified by:
        preRemove in interface io.micronaut.data.event.EntityEventListener<java.lang.Object>
      • postRemove

        public void postRemove​(@NonNull
                               io.micronaut.data.event.EntityEventContext<java.lang.Object> context)
        Specified by:
        postRemove in interface io.micronaut.data.event.EntityEventListener<java.lang.Object>
      • preUpdate

        public boolean preUpdate​(@NonNull
                                 io.micronaut.data.event.EntityEventContext<java.lang.Object> context)
        Specified by:
        preUpdate in interface io.micronaut.data.event.EntityEventListener<java.lang.Object>
      • postUpdate

        public void postUpdate​(@NonNull
                               io.micronaut.data.event.EntityEventContext<java.lang.Object> context)
        Specified by:
        postUpdate in interface io.micronaut.data.event.EntityEventListener<java.lang.Object>
      • process

        public void process​(io.micronaut.inject.BeanDefinition<?> beanDefinition,
                            io.micronaut.inject.ExecutableMethod<?,​?> method)
        Specified by:
        process in interface io.micronaut.context.processor.AnnotationProcessor<io.micronaut.data.annotation.event.EntityEventMapping,​io.micronaut.inject.ExecutableMethod<?,​?>>
        Specified by:
        process in interface io.micronaut.context.processor.ExecutableMethodProcessor<io.micronaut.data.annotation.event.EntityEventMapping>