Class SpringBeanPersistenceHookProvider
java.lang.Object
de.hybris.platform.inboundservices.persistence.hook.impl.SpringBeanPersistenceHookProvider
- All Implemented Interfaces:
PersistenceHookProvider,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class SpringBeanPersistenceHookProvider
extends Object
implements PersistenceHookProvider, org.springframework.context.ApplicationContextAware
Provides persistence hooks, which are defined as Spring Beans in the application context. Spring Bean hooks should be prefixed
with "bean://" in the request headers specifying the hook name; or they may use no prefix. For example, if a custom deployment
registers a persistence hook named "myTaxCalculator" in the spring.xml. Then the bean should be referred as
"bean://myTaxCalculator" or simply "myTaxCalculator" in the request headers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPostPersistHook(@NotNull PersistenceContext context) Retrieves aPostPersistHookby the hook name.getPrePersistHook(@NotNull PersistenceContext context) Retrieves aPrePersistHookby the hook name.voidsetApplicationContext(org.springframework.context.ApplicationContext context)
-
Constructor Details
-
SpringBeanPersistenceHookProvider
public SpringBeanPersistenceHookProvider()
-
-
Method Details
-
getPrePersistHook
Description copied from interface:PersistenceHookProviderRetrieves aPrePersistHookby the hook name.- Specified by:
getPrePersistHookin interfacePersistenceHookProvider- Parameters:
context- context of the data being persisted.- Returns:
- a hook matching the persistence context or an
Optional.empty(), if there is no hook for the provided context.
-
getPostPersistHook
Description copied from interface:PersistenceHookProviderRetrieves aPostPersistHookby the hook name.- Specified by:
getPostPersistHookin interfacePersistenceHookProvider- Parameters:
context- context of the data being persisted.- Returns:
- a hook matching the persistence context or an
Optional.empty(), if there is no hook for the provided context..
-
setApplicationContext
public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext context) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-