Class GenericResourcePublishEntityListener
java.lang.Object
ch.tocco.nice2.persist.core.api.util.CollectingAfterFlushEntityListener
ch.tocco.nice2.dms.impl.entitylistener.publishresource.GenericResourcePublishEntityListener
- All Implemented Interfaces:
EntityFacadeListener, CommitListener, EventListener
Generic listener that publishes Resources satisfying any of the contributed
GenericResourcePublishPredicateSuppliers'
Predicate
Must run after EntityDocumentsPropagateRelationEntityListener which is ensured by implementing
this listener as CollectingAfterFlushEntityListener (EntityDocumentsPropagateRelationEntityListener
is a normal CollectingEntityListener and runs before the after flush listeners). However the stuff here
should happen in the same transaction and not as an after task as other code might rely on the entity documents
being already published (so no CollectingAfterCommitListener can be used here).-
Nested Class Summary
Nested classes/interfaces inherited from class CollectingAfterFlushEntityListener
CollectingAfterFlushEntityListener.EntityContext -
Constructor Summary
ConstructorsConstructorDescriptionGenericResourcePublishEntityListener(CascadingDeleteService cascadingDeleteService, SecurityManager securityManager, CommandExecutor commandExecutor) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintpriority()Defines execution order of allCollectingAfterFlushEntityListener.voidsetGenericResourcePublishPredicateSuppliers(List<GenericResourcePublishPredicateSupplier> suppliers) Methods inherited from class CollectingAfterFlushEntityListener
afterCommit, afterFlush, beforeCommit, createEntityContext, entityChanging, entityCreating, entityDeleting, entityRelationChanging, getEntityContext, onEntityChanging, onEntityCreating, onEntityDeleting, onEntityRelationChangingMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntityFacadeListener
entityReceivedValues, handleSessionOnlyEntity
-
Constructor Details
-
GenericResourcePublishEntityListener
public GenericResourcePublishEntityListener(CascadingDeleteService cascadingDeleteService, SecurityManager securityManager, CommandExecutor commandExecutor)
-
-
Method Details
-
onAfterFlush
- Specified by:
onAfterFlushin classCollectingAfterFlushEntityListener- Returns:
- true if this listeners has made any changes to the database
-
priority
public int priority()Description copied from class:CollectingAfterFlushEntityListenerDefines execution order of allCollectingAfterFlushEntityListener. It is important to make sure that other listeners are not affected.- Specified by:
priorityin interfaceCommitListener- Specified by:
priorityin classCollectingAfterFlushEntityListener
-
setGenericResourcePublishPredicateSuppliers
@Autowired public void setGenericResourcePublishPredicateSuppliers(List<GenericResourcePublishPredicateSupplier> suppliers)
-