title: how to inject an array of Beans in spring boot?
body: <p>In Spring, we can inject a bean like bellowing code:</p>
  <pre class="lang-java prettyprint-override"><code>
      @Bean
      public AspectJExpressionPointcutAdvisor configurabledvisor() {
          System.out.println(&quot;configurabledvisor&quot;);
          AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor();
          advisor.setExpression(pointcut);
          advisor.setAdvice(new LogAroundAdvice());
          return advisor;
      }
  
  </code></pre>
  <p>In some situation, it is needed that an array of beans should be injected, the pseudo code like that:</p>
  <pre class="lang-java prettyprint-override"><code>
      @Bean[]
      public AspectJExpressionPointcutAdvisor[] configurabledvisorArray() {
          System.out.println(&quot;configurabledvisor&quot;);
          AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor();
          advisor.setExpression(pointcut);
          advisor.setAdvice(new LogAroundAdvice());
      
          AspectJExpressionPointcutAdvisor advisor1 = new AspectJExpressionPointcutAdvisor();
          advisor.setExpression(pointcut2);
          advisor.setAdvice(new AnotherAdvice());
          
          return new AspectJExpressionPointcutAdvisor[]{advisor, advisor1};
      }
  
  </code></pre>
  <p>Any help would be appreciated, thanks in advance.</p>
  <p>Demo code address is: <a href="https://github.com/sluk3r/inject-multipleBeans/tree/main" rel="nofollow noreferrer">https://github.com/sluk3r/inject-multipleBeans/tree/main</a></p>