Class CliComponentScanConfig
<context:component-scan> blocks previously declared in
applicationContext-component-scan.xml.
Three scans, matching the legacy XML exactly:
ubic.gemma.cli— standard stereotype scan with theTestComponentexclude filter. Picks up CLI-specific@Component/@Service/etc. beans.ubic.gemma.apps— restricted scan: default filters off, include filter on theCLIinterface (assignable type), withPrototypeScopeResolverso each CLI tool is created per-invocation rather than as a singleton. This is how the in-tree CLI tools get registered.ubic.gemma.contrib.apps— identical to (2), for out-of-tree CLI tools dropped into the contrib classpath.
BeanNameGenerator (camel-case, strips trailing
"Impl") to match the legacy XML's name-generator attribute.
Also re-declares the LazyInitByDefaultPostProcessor bean that the XML defined
as a bare <bean class="..."/>; the post-processor must be returned from a
static @Bean method so the container instantiates it before the
@Configuration class is fully populated (it's a BeanFactoryPostProcessor).
The whole configuration is gated on the cli profile, matching the legacy XML's
profile="cli" attribute, so the CLI scans don't fire in web/REST contexts.
Wired in applicationContext-component-scan.xml as a <bean> so the
existing wildcard XML loader (classpath*:ubic/gemma/applicationContext-*.xml —
see SpringContextUtils and the various CLI bootstrap paths) still discovers it
without classpath-order surgery.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ubic.gemma.core.context.LazyInitByDefaultPostProcessorRe-creates the bare<bean class="ubic.gemma.core.context.LazyInitByDefaultPostProcessor"/>from the legacy XML.
-
Constructor Details
-
CliComponentScanConfig
public CliComponentScanConfig()
-
-
Method Details
-
lazyInitByDefaultPostProcessor
@Bean public static ubic.gemma.core.context.LazyInitByDefaultPostProcessor lazyInitByDefaultPostProcessor()Re-creates the bare<bean class="ubic.gemma.core.context.LazyInitByDefaultPostProcessor"/>from the legacy XML. Must bestaticbecause the bean is aBeanFactoryPostProcessorand Spring needs to instantiate it before the enclosing @Configuration is processed.
-