Stream < Entity > updateEntities ( String repoFullName , Stream < Entity > entities ) { lock . readLock ( ) . lock ( ) ; try { verifyRepoRegistered ( repoFullName ) ; SetMultimap < Object , EntityListener > entityListeners = this . entityListenersByRepo . get ( repoFullName ) ; return entities . filter ( entity -> { Set < EntityListener > entityEntityListeners = entityListeners . get ( entity . getIdValue ( ) ) ; entityEntityListeners . forEach ( entityListener -> entityListener . postUpdate ( entity ) ) ; return true ; } ) ; } finally { lock . readLock ( ) . unlock ( ) ; } }
Update all registered listeners of the entities