title: Component Scan for custom annotation on Interface
body: <p>I have a component scan configuration as this:</p>
  
  <pre><code>   @Configuration
     @ComponentScan(basePackageClasses = {ITest.class},
                    includeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, value = JdbiRepository.class)})
     public class MyConfig {
  
     }
  </code></pre>
  
  <p>Basically I would like to create scan interface which has <code>JdbiRepository</code> annotation</p>
  
  <pre><code>@JdbiRepository
  public interface ITest {
    Integer deleteUserSession(String id);
  }
  </code></pre>
  
  <p>And I would like to create proxy implementation of my interfaces. For this purpose I registered a custom <code>SmartInstantiationAwareBeanPostProcessor</code> which is basically creating necessary instances but the configuration above does not scan interfaces which has <code>JdbiRepository</code> annotation.</p>
  
  <p>How can I scan interfaces by custom annotation?</p>
  
  <p>Edit: </p>
  
  <p>It seems that <code>org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider#isCandidateComponent</code> is accepting only concrete classes.</p>
  
  <pre><code>/**
   * Determine whether the given bean definition qualifies as candidate.
   * &lt;p&gt;The default implementation checks whether the class is concrete
   * (i.e. not abstract and not an interface). Can be overridden in subclasses.
   * @param beanDefinition the bean definition to check
   * @return whether the bean definition qualifies as a candidate component
   */
  protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) {
      return (beanDefinition.getMetadata().isConcrete() &amp;&amp; beanDefinition.getMetadata().isIndependent());
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <pre><code>@Target({ElementType.TYPE})
  @Retention(RetentionPolicy.RUNTIME)
  @Documented
  @Component
  public @interface JdbiRepository {
  
     /**
      * The value may indicate a suggestion for a logical component name,
      * to be turned into a Spring bean in case of an autodetected component.
      * @return the suggested component name, if any
      */
     String value() default "";
  }
  </code></pre>