Class ServiceBeansConfig
applicationContext-serviceBeans.xml — entityUrlBuilder, taskExecutor,
and expressionDataFileTaskExecutor.
Bean ids are preserved exactly because other code (XML wiring elsewhere, @Qualifier
references, and applicationContext.getBean("taskExecutor") call sites) resolves them
by name.
The metrics profile beans from the original XML are migrated separately in
MetricsConfig. The dead MeterRegistryEhcacheConfigurer bean (whose backing
class was removed in the Phase 2 EhCache retirement) is intentionally not carried over —
the metrics profile is opt-in and was never being instantiated anyway.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAConcurrentTaskExecutorthat waits for its pending tasks when the context is stopped. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentityUrlBuilder(String hostUrl) MarkedPrimarybecause gsec's XML also defines anentityUrlBuilderbean (with a different host-url source); the legacy XML usedprimary="true"so that Gemma's host-url-configured builder wins over gsec's at injection sites that ask for the type without qualifier.expressionDataFileTaskExecutor(VirtualThreadExecutorMetrics expressionDataFileTaskExecutorMetrics, int shutdownTimeoutSeconds) Executor for generating data files (CEL / count matrices / TSVs).Micrometer binder for theexpressionDataFileTaskExecutor(VirtualThreadExecutorMetrics, int)VT executor.org.springframework.scheduling.concurrent.ThreadPoolTaskExecutortaskExecutor(int corePoolSize) Local short-lived task executor.
-
Constructor Details
-
ServiceBeansConfig
public ServiceBeansConfig()
-
-
Method Details
-
entityUrlBuilder
MarkedPrimarybecause gsec's XML also defines anentityUrlBuilderbean (with a different host-url source); the legacy XML usedprimary="true"so that Gemma's host-url-configured builder wins over gsec's at injection sites that ask for the type without qualifier. -
taskExecutor
@Bean(name="taskExecutor") @Primary public org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor taskExecutor(@Value("${gemma.localTasks.corePoolSize}") int corePoolSize) Local short-lived task executor. MarkedPrimaryso that injection points asking forTaskExecutor(without a qualifier) get this one rather thanexpressionDataFileTaskExecutor. -
expressionDataFileTaskExecutor
@Bean(name="expressionDataFileTaskExecutor") public ServiceBeansConfig.DrainingTaskExecutor expressionDataFileTaskExecutor(VirtualThreadExecutorMetrics expressionDataFileTaskExecutorMetrics, @Value("${gemma.expressionDataFileTasks.shutdownTimeoutSeconds:60}") int shutdownTimeoutSeconds) Executor for generating data files (CEL / count matrices / TSVs).JDK 21 migration: backed by a virtual-thread-per-task executor wrapped through Spring's
ConcurrentTaskExecutorso it still implementsAsyncTaskExecutor(callersexecute/submitvia that interface).Behavioural change vs. the previous
ThreadPoolTaskExecutor: submission never blocks and never throwsTaskRejectedException, because there is no bounded queue and no fixed worker pool. Concurrency is bounded only by the number of in-flight VTs the JVM is willing to mount. Thegemma.expressionDataFileTasks.corePoolSizeand.queueCapacityproperties no longer constrain this executor. The two consumers (DifferentialExpressionAnalyzerServiceImpl, ExpressionDataFileServiceImpl) both treatTaskRejectedExceptionas a soft failure ("archive will be rebuilt on next read"), so dropping queue-based backpressure is safe.Pending tasks are waited for when the context closes, for at most
gemma.expressionDataFileTasks.shutdownTimeoutSeconds; seeServiceBeansConfig.DrainingTaskExecutor. -
expressionDataFileTaskExecutorMetrics
Micrometer binder for theexpressionDataFileTaskExecutor(VirtualThreadExecutorMetrics, int)VT executor. Picked up byMetricsConfig#genericMeterRegistryConfigurerwhen themetricsprofile is active. Defined as its own bean so the wrap-with-metrics path is exercised regardless of profile (a no-opbindTowhen no registry is calling it).
-