Class AutowireAware

java.lang.Object
io.github.astrapi69.spring.autowire.AutowireAware
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

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

    • autowire

      public static void autowire(Object classHolderToAutowire, 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