Class ComponentScanConfig

java.lang.Object
ubic.gemma.core.config.ComponentScanConfig

@Configuration @ComponentScan(basePackages={"ubic.gemma.core","ubic.gemma.persistence"}, nameGenerator=BeanNameGenerator.class, excludeFilters=) @EnableAspectJAutoProxy @ImportResource("classpath*:ubic/gemma/core/security/applicationContext-*.xml") public class ComponentScanConfig extends Object
Phase 3 XML->Java migration: replaces applicationContext-component-scan.xml.

Defines the component-scan that pulls in every @Component / @Service / @Repository / @Controller / @Configuration bean under ubic.gemma.core and ubic.gemma.persistence. Beans annotated TestComponent are excluded — those are picked up only by test contexts.

The ubic.gemma.web package is deliberately not scanned here; it is brought in by gemma-servlet.xml in the gemma-web module.

Bean ids are produced by BeanNameGenerator (camel-case, strips trailing "Impl") — matching the legacy XML's name-generator attribute exactly.

Bootstrapped from the thin applicationContext-component-scan.xml stub that declares <context:annotation-config/> plus <bean class="...ComponentScanConfig"/>. The stub is required because the XML wildcard loader (classpath*:ubic/gemma/applicationContext-*.xml) needs at least one XML entry point; once this @Configuration is registered, its @ComponentScan handles the rest.

EnableAspectJAutoProxy is declared here so AspectJ annotation-driven proxying is enabled once at the root scan, covering every @Aspect bean picked up under ubic.gemma.core / ubic.gemma.persistence (audit advice, @Timed via micrometer's TimedAspect, etc.). Replaces the three legacy XML <aop:aspectj-autoproxy/> declarations from applicationContext-security.xml, applicationContext-serviceBeans.xml, and applicationContext-hibernate.xml. Default proxyTargetClass=false matches the XML behaviour (interface-based JDK proxies where available, CGLIB fallback).

  • Constructor Details

    • ComponentScanConfig

      public ComponentScanConfig()