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 Details

    • SpringBeanPersistenceHookProvider

      public SpringBeanPersistenceHookProvider()
  • Method Details

    • getPrePersistHook

      public Optional<PrePersistHook> getPrePersistHook(@NotNull @NotNull PersistenceContext context)
      Description copied from interface: PersistenceHookProvider
      Retrieves a PrePersistHook by the hook name.
      Specified by:
      getPrePersistHook in interface PersistenceHookProvider
      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

      public Optional<PostPersistHook> getPostPersistHook(@NotNull @NotNull PersistenceContext context)
      Description copied from interface: PersistenceHookProvider
      Retrieves a PostPersistHook by the hook name.
      Specified by:
      getPostPersistHook in interface PersistenceHookProvider
      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:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware