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
ConstructorsConstructorDescriptionEventPublishingRepositoryProxyPostProcessor
(org.springframework.context.ApplicationEventPublisher publisher) Creates a newEventPublishingRepositoryProxyPostProcessor
for the givenApplicationEventPublisher
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
postProcess
(org.springframework.aop.framework.ProxyFactory factory, RepositoryInformation repositoryInformation) Manipulates theProxyFactory
, e.g. add further interceptors to it.
-
Constructor Details
-
EventPublishingRepositoryProxyPostProcessor
public EventPublishingRepositoryProxyPostProcessor(org.springframework.context.ApplicationEventPublisher publisher) Creates a newEventPublishingRepositoryProxyPostProcessor
for the givenApplicationEventPublisher
.- Parameters:
publisher
- must not be null.
-
-
Method Details
-
postProcess
public void postProcess(org.springframework.aop.framework.ProxyFactory factory, RepositoryInformation repositoryInformation) Description copied from interface:RepositoryProxyPostProcessor
Manipulates theProxyFactory
, e.g. add further interceptors to it.- Specified by:
postProcess
in interfaceRepositoryProxyPostProcessor
- Parameters:
factory
- will never be null.repositoryInformation
- will never be null.
-