Class AutowireAware

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    @Component
    public final class AutowireAware
    extends java.lang.Object
    implements org.springframework.context.ApplicationContextAware
    Utility class for autowire classes like in jpa listeners
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void autowire​(java.lang.Object classHolderToAutowire, java.lang.Object... beansToAutowireInClass)
      Try to autowire the given object that contains the bean instances which need to be autowired
      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
    • Method Detail

      • autowire

        public static void autowire​(java.lang.Object classHolderToAutowire,
                                    java.lang.Object... beansToAutowireInClass)
        Try to autowire the given object that contains the bean instances which need to be autowired
        Parameters:
        classHolderToAutowire - the holder instance of the class which holds @Autowire annotations
        beansToAutowireInClass - the beans which have the @Autowire annotation in the specified {#classHolderToAutowire}
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware