Class DefaultPersistenceHookRegistry
- java.lang.Object
-
- de.hybris.platform.odata2services.odata.persistence.hook.impl.DefaultPersistenceHookRegistry
-
- All Implemented Interfaces:
PersistenceHookRegistry,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class DefaultPersistenceHookRegistry extends java.lang.Object implements PersistenceHookRegistry, org.springframework.context.ApplicationContextAware
An implementation of thePersistenceHookRegistry, which loads persistence hooks from the Spring application context. Spring Bean names/ids become names of the hooks in this registry.
-
-
Constructor Summary
Constructors Constructor Description DefaultPersistenceHookRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHook(java.lang.String hookName, PostPersistHook hook)voidaddHook(java.lang.String hookName, PrePersistHook hook)protected <T> TgetHook(java.util.Map<java.lang.String,T> hooks, java.lang.String prefix, java.lang.String hookName, java.lang.String integrationKey)PostPersistHookgetPostPersistHook(java.lang.String hookName, java.lang.String integrationKey)Retrieves aPostPersistHookby the hook name.PrePersistHookgetPrePersistHook(java.lang.String hookName, java.lang.String integrationKey)Retrieves aPrePersistHookby the hook name.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
-
-
Method Detail
-
getPrePersistHook
public PrePersistHook getPrePersistHook(java.lang.String hookName, java.lang.String integrationKey)
Description copied from interface:PersistenceHookRegistryRetrieves aPrePersistHookby the hook name.- Specified by:
getPrePersistHookin interfacePersistenceHookRegistry- Parameters:
hookName- name of the hook to retrieve. It's up to the implementation what that name means and how hooks are named.integrationKey- for the current item that is being created or updated- Returns:
- a hook matching the name.
-
getPostPersistHook
public PostPersistHook getPostPersistHook(java.lang.String hookName, java.lang.String integrationKey)
Description copied from interface:PersistenceHookRegistryRetrieves aPostPersistHookby the hook name.- Specified by:
getPostPersistHookin interfacePersistenceHookRegistry- Parameters:
hookName- name of the hook to retrieve. It's up to implementation what that name means and how hooks are named.integrationKey- for the current item that is being created or updated- Returns:
- a hook matching the name.
-
addHook
public void addHook(java.lang.String hookName, PrePersistHook hook)
-
addHook
public void addHook(java.lang.String hookName, PostPersistHook hook)
-
getHook
protected <T> T getHook(java.util.Map<java.lang.String,T> hooks, java.lang.String prefix, java.lang.String hookName, java.lang.String integrationKey)
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
-