Class 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 the PersistenceHookRegistry, which loads persistence hooks from the Spring application context. Spring Bean names/ids become names of the hooks in this registry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addHook​(java.lang.String hookName, PostPersistHook hook)  
      void addHook​(java.lang.String hookName, PrePersistHook hook)  
      protected <T> T getHook​(java.util.Map<java.lang.String,​T> hooks, java.lang.String prefix, java.lang.String hookName, java.lang.String integrationKey)  
      PostPersistHook getPostPersistHook​(java.lang.String hookName, java.lang.String integrationKey)
      Retrieves a PostPersistHook by the hook name.
      PrePersistHook getPrePersistHook​(java.lang.String hookName, java.lang.String integrationKey)
      Retrieves a PrePersistHook by the hook name.
      void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultPersistenceHookRegistry

        public DefaultPersistenceHookRegistry()
    • Method Detail

      • getPrePersistHook

        public PrePersistHook getPrePersistHook​(java.lang.String hookName,
                                                java.lang.String integrationKey)
        Description copied from interface: PersistenceHookRegistry
        Retrieves a PrePersistHook by the hook name.
        Specified by:
        getPrePersistHook in interface PersistenceHookRegistry
        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: PersistenceHookRegistry
        Retrieves a PostPersistHook by the hook name.
        Specified by:
        getPostPersistHook in interface PersistenceHookRegistry
        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:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware