Class MongoMappingEventPublisher
java.lang.Object
org.springframework.data.mongodb.core.index.MongoMappingEventPublisher
- All Implemented Interfaces:
ApplicationEventPublisher
An implementation of ApplicationEventPublisher that will only fire
MappingContextEvent
s for use by the index
creator when MongoTemplate is used 'stand-alone', that is not declared inside a Spring ApplicationContext
.
Declare MongoTemplate
inside an ApplicationContext
to enable the publishing of all persistence events
such as AfterLoadEvent
, AfterSaveEvent
, etc.- Author:
- Jon Brisbin, Oliver Gierke, Mark Paluch
-
Constructor Summary
ConstructorDescriptionMongoMappingEventPublisher
(ApplicationListener<MappingContextEvent<?, ?>> indexCreator) Creates a newMongoMappingEventPublisher
for the givenApplicationListener
.MongoMappingEventPublisher
(MongoPersistentEntityIndexCreator indexCreator) Creates a newMongoMappingEventPublisher
for the givenMongoPersistentEntityIndexCreator
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
publishEvent
(Object event) void
publishEvent
(ApplicationEvent event)
-
Constructor Details
-
MongoMappingEventPublisher
Creates a newMongoMappingEventPublisher
for the givenApplicationListener
.- Parameters:
indexCreator
- must not be null.- Since:
- 2.1
-
MongoMappingEventPublisher
Creates a newMongoMappingEventPublisher
for the givenMongoPersistentEntityIndexCreator
.- Parameters:
indexCreator
- must not be null.
-
-
Method Details
-
publishEvent
- Specified by:
publishEvent
in interfaceApplicationEventPublisher
-
publishEvent
- Specified by:
publishEvent
in interfaceApplicationEventPublisher
-