Class TopiaFiresSupport

java.lang.Object
org.nuiton.topia.persistence.internal.support.AbstractTopiaListenableSupport
org.nuiton.topia.persistence.internal.support.TopiaFiresSupport
All Implemented Interfaces:
TopiaListenableSupport

public class TopiaFiresSupport extends AbstractTopiaListenableSupport implements TopiaListenableSupport
Contains all about event listening and propagation.
Author:
jruchaud : jruchaud@codelutin.com, Arnaud Thimel (Code Lutin)
  • Field Details

    • NO_CHANGE

      protected static final Object NO_CHANGE
      Used to fire read event
    • parent

      protected TopiaFiresSupport parent
      Each TopiaFiresSupport may have a parent on which events will be propagated. Basically, a TopiaFiresSupport without parent is used by the TopiaApplicationContext, and a TopiaFiresSupport with a parent is used by the TopiaPersistenceContext.
  • Constructor Details

  • Method Details

    • getEntityState

      protected EntityState getEntityState(TopiaEntity entity)
      Get or create the entity state from the AbstractTopiaListenableSupport.transactionEntities map. This method always returns an instance.
      Parameters:
      entity - the entity instance
      Returns:
      the EntityState for the given entity.
    • notifyEntityLoaded

      public void notifyEntityLoaded(TopiaEntity entity)
      Register an entity loaded during the current transaction.
      Parameters:
      entity - the loaded entity
    • notifyEntityCreated

      public void notifyEntityCreated(TopiaEntity entity)
      Register an entity created during the current transaction.
      Parameters:
      entity - the created entity
    • notifyEntityRead

      public void notifyEntityRead(TopiaEntity entity)
      used to register objects loaded during transaction.
      Parameters:
      entity - the read entity
    • notifyEntityUpdated

      public void notifyEntityUpdated(TopiaEntity entity)
      used to register objects modified (update) during transaction.
      Parameters:
      entity - the updated entity
    • notifyEntityWritten

      public void notifyEntityWritten(TopiaEntity entity)
      used to register objects modified (setter) during transaction.
      Parameters:
      entity - the updated entity
    • notifyEntityDeleted

      public void notifyEntityDeleted(TopiaEntity entity)
      used to register objects deleted during transaction.
      Parameters:
      entity - the deleted entity
    • isNotEmpty

      protected boolean isNotEmpty(org.nuiton.util.ListenerSet<?> set)
    • isNotEmpty

      protected boolean isNotEmpty(Set<?> set)
    • isNotEmpty

      protected boolean isNotEmpty(org.nuiton.util.CategorisedListenerSet<?> set, Class<?> category)
    • fireOnBeginTransaction

      public void fireOnBeginTransaction(TopiaPersistenceContext context)
    • fireOnPostCommit

      public void fireOnPostCommit(TopiaPersistenceContext context)
    • fireOnPostRollback

      public void fireOnPostRollback(TopiaPersistenceContext context)
    • fireOnPreLoad

      public void fireOnPreLoad(TopiaPersistenceContext context, TopiaEntity entity, Object[] state)
    • fireOnPostLoad

      public void fireOnPostLoad(TopiaPersistenceContext context, TopiaEntity entity, Object[] state)
    • fireOnPreCreate

      public void fireOnPreCreate(TopiaPersistenceContext context, TopiaEntity entity, Object[] state)
    • fireOnPostCreate

      public void fireOnPostCreate(TopiaPersistenceContext context, TopiaEntity entity, Object[] state)
    • fireOnPreUpdate

      public void fireOnPreUpdate(TopiaPersistenceContext context, TopiaEntity entity, Object[] state)
    • fireOnPostUpdate

      public void fireOnPostUpdate(TopiaPersistenceContext context, TopiaEntity entity, Object[] state)
    • fireOnPreDelete

      public void fireOnPreDelete(TopiaPersistenceContext context, TopiaEntity entity, Object[] state)
    • fireOnPostDelete

      public void fireOnPostDelete(TopiaPersistenceContext context, TopiaEntity entity, Object[] state)
    • fireOnPreRead

      public void fireOnPreRead(VetoableChangeSupport vetoables, TopiaEntity entity, String propertyName, Object value)
    • fireOnPostRead

      public void fireOnPostRead(PropertyChangeSupport listeners, TopiaEntity entity, String propertyName, Object value)
    • fireOnPostRead

      public void fireOnPostRead(PropertyChangeSupport listeners, TopiaEntity entity, String propertyName, int index, Object value)
    • fireOnPreWrite

      public void fireOnPreWrite(VetoableChangeSupport vetoables, TopiaEntity entity, String propertyName, Object oldValue, Object newValue)
    • fireOnPostWrite

      public void fireOnPostWrite(PropertyChangeSupport listeners, TopiaEntity entity, String propertyName, Object oldValue, Object newValue)
    • fireOnPostWrite

      public void fireOnPostWrite(PropertyChangeSupport listeners, TopiaEntity entity, String propertyName, int index, Object oldValue, Object newValue)
    • firePreCreateSchema

      public void firePreCreateSchema(TopiaApplicationContext context)
      Notify topia context listeners for create schema pre operation
      Parameters:
      context - topia context
    • firePostCreateSchema

      public void firePostCreateSchema(TopiaApplicationContext context)
      Notify topia context listeners for create schema post operation
      Parameters:
      context - topia context
    • firePreUpdateSchema

      public void firePreUpdateSchema(TopiaApplicationContext context)
      Notify topia context listeners for create schema pre operation
      Parameters:
      context - topia context
    • firePostUpdateSchema

      public void firePostUpdateSchema(TopiaApplicationContext context)
      Notify topia context listeners for create schema post operation
      Parameters:
      context - topia context
    • firePreDropSchema

      public void firePreDropSchema(TopiaApplicationContext context)
      Notify topia context listeners for drop schema pre operation
      Parameters:
      context - topia context
      Since:
      3.0
    • firePostDropSchema

      public void firePostDropSchema(TopiaApplicationContext context)
      Notify topia context listeners for drop schema post operation
      Parameters:
      context - topia context
      Since:
      3.0
    • fireEntitiesLoad

      public <E extends TopiaEntity> List<E> fireEntitiesLoad(TopiaJpaSupport context, List<E> entities)
      Notify entities listeners for load operation
      Type Parameters:
      E - type of entities
      Parameters:
      context - context used
      entities - entities loaded
      Returns:
      the list of entities loaded