Class BaseEntityEventListener

    • Field Detail

      • failOnException

        protected boolean failOnException
      • entityClass

        protected Class<?> entityClass
    • Constructor Detail

      • BaseEntityEventListener

        public BaseEntityEventListener()
        Create a new BaseEntityEventListener, notified when an event that targets any type of entity is received. Returning true when isFailOnException() is called.
      • BaseEntityEventListener

        public BaseEntityEventListener​(boolean failOnException)
        Create a new BaseEntityEventListener.
        Parameters:
        failOnException - return value for isFailOnException().
      • BaseEntityEventListener

        public BaseEntityEventListener​(boolean failOnException,
                                       Class<?> entityClass)
    • Method Detail

      • isFailOnException

        public boolean isFailOnException()
        Specified by:
        isFailOnException in interface ActivitiEventListener
        Returns:
        whether or not the current operation should fail when this listeners execution throws an exception.
      • isValidEvent

        protected boolean isValidEvent​(ActivitiEvent event)
        Returns:
        true, if the event is an ActivitiEntityEvent and (if needed) the entityClass set in this instance, is assignable from the entity class in the event.
      • onCreate

        protected void onCreate​(ActivitiEvent event)
        Called when an entity create event is received.
      • onInitialized

        protected void onInitialized​(ActivitiEvent event)
        Called when an entity initialized event is received.
      • onDelete

        protected void onDelete​(ActivitiEvent event)
        Called when an entity delete event is received.
      • onUpdate

        protected void onUpdate​(ActivitiEvent event)
        Called when an entity update event is received.
      • onEntityEvent

        protected void onEntityEvent​(ActivitiEvent event)
        Called when an event is received, which is not a create, an update or delete.