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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final ObjectUsed to fire read eventprotected TopiaFiresSupportEach TopiaFiresSupport may have a parent on which events will be propagated.Fields inherited from class org.nuiton.topia.persistence.internal.support.AbstractTopiaListenableSupport
entitiesVetoables, entityListeners, entityVetoables, propertyChangeListeners, topiaSchemaListeners, transactionEntities, transactionListeners, transactionVetoables -
Constructor Summary
ConstructorsConstructorDescriptionConstructor to be used by theTopiaApplicationContextTopiaFiresSupport(TopiaFiresSupport parent) Constructor to be used by theTopiaPersistenceContext. -
Method Summary
Modifier and TypeMethodDescription<E extends TopiaEntity>
List<E>fireEntitiesLoad(TopiaJpaSupport context, List<E> entities) Notify entities listeners for load operationvoidvoidfireOnPostCommit(TopiaPersistenceContext context) voidfireOnPostCreate(TopiaPersistenceContext context, TopiaEntity entity, Object[] state) voidfireOnPostDelete(TopiaPersistenceContext context, TopiaEntity entity, Object[] state) voidfireOnPostLoad(TopiaPersistenceContext context, TopiaEntity entity, Object[] state) voidfireOnPostRead(PropertyChangeSupport listeners, TopiaEntity entity, String propertyName, int index, Object value) voidfireOnPostRead(PropertyChangeSupport listeners, TopiaEntity entity, String propertyName, Object value) voidvoidfireOnPostUpdate(TopiaPersistenceContext context, TopiaEntity entity, Object[] state) voidfireOnPostWrite(PropertyChangeSupport listeners, TopiaEntity entity, String propertyName, int index, Object oldValue, Object newValue) voidfireOnPostWrite(PropertyChangeSupport listeners, TopiaEntity entity, String propertyName, Object oldValue, Object newValue) voidfireOnPreCreate(TopiaPersistenceContext context, TopiaEntity entity, Object[] state) voidfireOnPreDelete(TopiaPersistenceContext context, TopiaEntity entity, Object[] state) voidfireOnPreLoad(TopiaPersistenceContext context, TopiaEntity entity, Object[] state) voidfireOnPreRead(VetoableChangeSupport vetoables, TopiaEntity entity, String propertyName, Object value) voidfireOnPreUpdate(TopiaPersistenceContext context, TopiaEntity entity, Object[] state) voidfireOnPreWrite(VetoableChangeSupport vetoables, TopiaEntity entity, String propertyName, Object oldValue, Object newValue) voidNotify topia context listeners for create schema post operationvoidNotify topia context listeners for drop schema post operationvoidNotify topia context listeners for create schema post operationvoidNotify topia context listeners for create schema pre operationvoidfirePreDropSchema(TopiaApplicationContext context) Notify topia context listeners for drop schema pre operationvoidNotify topia context listeners for create schema pre operationprotected EntityStategetEntityState(TopiaEntity entity) Get or create the entity state from theAbstractTopiaListenableSupport.transactionEntitiesmap.protected booleanisNotEmpty(Set<?> set) protected booleanisNotEmpty(org.nuiton.util.CategorisedListenerSet<?> set, Class<?> category) protected booleanisNotEmpty(org.nuiton.util.ListenerSet<?> set) voidnotifyEntityCreated(TopiaEntity entity) Register an entity created during the current transaction.voidnotifyEntityDeleted(TopiaEntity entity) used to register objects deleted during transaction.voidnotifyEntityLoaded(TopiaEntity entity) Register an entity loaded during the current transaction.voidnotifyEntityRead(TopiaEntity entity) used to register objects loaded during transaction.voidnotifyEntityUpdated(TopiaEntity entity) used to register objects modified (update) during transaction.voidnotifyEntityWritten(TopiaEntity entity) used to register objects modified (setter) during transaction.Methods inherited from class org.nuiton.topia.persistence.internal.support.AbstractTopiaListenableSupport
addPropertyChangeListener, addTopiaEntitiesVetoable, addTopiaEntityListener, addTopiaEntityListener, addTopiaEntityVetoable, addTopiaEntityVetoable, addTopiaSchemaListener, addTopiaTransactionListener, addTopiaTransactionVetoable, removePropertyChangeListener, removeTopiaEntitiesVetoable, removeTopiaEntityListener, removeTopiaEntityListener, removeTopiaEntityVetoable, removeTopiaEntityVetoable, removeTopiaSchemaListener, removeTopiaTransactionListener, removeTopiaTransactionVetoableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuiton.topia.persistence.support.TopiaListenableSupport
addPropertyChangeListener, addTopiaEntitiesVetoable, addTopiaEntityListener, addTopiaEntityListener, addTopiaEntityVetoable, addTopiaEntityVetoable, addTopiaSchemaListener, addTopiaTransactionListener, addTopiaTransactionVetoable, removePropertyChangeListener, removeTopiaEntitiesVetoable, removeTopiaEntityListener, removeTopiaEntityListener, removeTopiaEntityVetoable, removeTopiaEntityVetoable, removeTopiaSchemaListener, removeTopiaTransactionListener, removeTopiaTransactionVetoable
-
Field Details
-
NO_CHANGE
Used to fire read event -
parent
Each TopiaFiresSupport may have a parent on which events will be propagated. Basically, a TopiaFiresSupport without parent is used by theTopiaApplicationContext, and a TopiaFiresSupport with a parent is used by theTopiaPersistenceContext.
-
-
Constructor Details
-
TopiaFiresSupport
public TopiaFiresSupport()Constructor to be used by theTopiaApplicationContext -
TopiaFiresSupport
Constructor to be used by theTopiaPersistenceContext.- Parameters:
parent- TheTopiaApplicationContext's instance
-
-
Method Details
-
getEntityState
Get or create the entity state from theAbstractTopiaListenableSupport.transactionEntitiesmap. This method always returns an instance.- Parameters:
entity- the entity instance- Returns:
- the
EntityStatefor the given entity.
-
notifyEntityLoaded
Register an entity loaded during the current transaction.- Parameters:
entity- the loaded entity
-
notifyEntityCreated
Register an entity created during the current transaction.- Parameters:
entity- the created entity
-
notifyEntityRead
used to register objects loaded during transaction.- Parameters:
entity- the read entity
-
notifyEntityUpdated
used to register objects modified (update) during transaction.- Parameters:
entity- the updated entity
-
notifyEntityWritten
used to register objects modified (setter) during transaction.- Parameters:
entity- the updated entity
-
notifyEntityDeleted
used to register objects deleted during transaction.- Parameters:
entity- the deleted entity
-
isNotEmpty
protected boolean isNotEmpty(org.nuiton.util.ListenerSet<?> set) -
isNotEmpty
-
isNotEmpty
-
fireOnBeginTransaction
-
fireOnPostCommit
-
fireOnPostRollback
-
fireOnPreLoad
-
fireOnPostLoad
-
fireOnPreCreate
-
fireOnPostCreate
-
fireOnPreUpdate
-
fireOnPostUpdate
-
fireOnPreDelete
-
fireOnPostDelete
-
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
Notify topia context listeners for create schema pre operation- Parameters:
context- topia context
-
firePostCreateSchema
Notify topia context listeners for create schema post operation- Parameters:
context- topia context
-
firePreUpdateSchema
Notify topia context listeners for create schema pre operation- Parameters:
context- topia context
-
firePostUpdateSchema
Notify topia context listeners for create schema post operation- Parameters:
context- topia context
-
firePreDropSchema
Notify topia context listeners for drop schema pre operation- Parameters:
context- topia context- Since:
- 3.0
-
firePostDropSchema
Notify topia context listeners for drop schema post operation- Parameters:
context- topia context- Since:
- 3.0
-
fireEntitiesLoad
Notify entities listeners for load operation- Type Parameters:
E- type of entities- Parameters:
context- context usedentities- entities loaded- Returns:
- the list of entities loaded
-