Class EventPublishingRepositoryProxyPostProcessor
java.lang.Object
org.springframework.data.repository.core.support.EventPublishingRepositoryProxyPostProcessor
- All Implemented Interfaces:
RepositoryProxyPostProcessor
public class EventPublishingRepositoryProxyPostProcessor
extends Object
implements RepositoryProxyPostProcessor
RepositoryProxyPostProcessor to register a MethodInterceptor to intercept
CrudRepository.save(Object) and CrudRepository.delete(Object) methods and publish events potentially
exposed via a method annotated with DomainEvents. If no such method can be detected on the aggregate root, no
interceptor is added. Additionally, the aggregate root can expose a method annotated with
AfterDomainEventPublication. If present, the method will be invoked after all events have been published.- Since:
- 1.13
- Author:
- Oliver Gierke, Christoph Strobl, Yuki Yoshida, Réda Housni Alaoui
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newEventPublishingRepositoryProxyPostProcessorfor the givenApplicationEventPublisher. -
Method Summary
Modifier and TypeMethodDescriptionvoidpostProcess(ProxyFactory factory, RepositoryInformation repositoryInformation) Manipulates theProxyFactory, e.g. add further interceptors to it.
-
Constructor Details
-
EventPublishingRepositoryProxyPostProcessor
Creates a newEventPublishingRepositoryProxyPostProcessorfor the givenApplicationEventPublisher.- Parameters:
publisher- must not be null.
-
-
Method Details
-
postProcess
Description copied from interface:RepositoryProxyPostProcessorManipulates theProxyFactory, e.g. add further interceptors to it.- Specified by:
postProcessin interfaceRepositoryProxyPostProcessor- Parameters:
factory- will never be null.repositoryInformation- will never be null.
-