Open-Source Wikis

/

Spring Framework

/

Modules

/

spring-context-support

spring-projects/spring-framework

spring-context-support

Active contributors: Juergen Hoeller, Sam Brannen

Purpose

spring-context-support extends spring-context with integrations to third-party libraries that don't justify their own modules: Quartz scheduling, JavaMail, Caffeine/JCache cache providers, and FreeMarker template loading helpers. It's the "kitchen sink" extension module.

Directory layout

spring-context-support/
└── src/main/java/org/springframework/
    ├── cache/
    │   ├── caffeine/                              # Caffeine cache integration
    │   └── jcache/                                # JSR-107 JCache integration
    ├── mail/                                      # JavaMail support
    │   ├── MailMessage.java
    │   ├── MailSender.java
    │   ├── SimpleMailMessage.java
    │   └── javamail/                              # JavaMail implementation
    ├── scheduling/quartz/                         # Quartz integration
    │   ├── SchedulerFactoryBean.java
    │   ├── JobDetailFactoryBean.java
    │   ├── CronTriggerFactoryBean.java
    │   └── …
    └── ui/freemarker/                             # FreeMarker template loader helpers

Key abstractions

Type File Role
MailSender / JavaMailSender spring-context-support/src/main/java/org/springframework/mail/ Email-sending API
JavaMailSenderImpl spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSenderImpl.java JavaMail-backed implementation
SchedulerFactoryBean spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java Bootstraps a Quartz Scheduler
JobDetailFactoryBean / CronTriggerFactoryBean spring-context-support/src/main/java/org/springframework/scheduling/quartz/ Quartz job and trigger declaration via Spring beans
CaffeineCacheManager spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCacheManager.java CacheManager backed by Caffeine
JCacheCacheManager spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCacheManager.java CacheManager backed by JSR-107

How it works

spring-context-support doesn't introduce new abstractions of its own — it provides Spring-friendly wiring for libraries that already exist:

  • Quartz — Spring beans for JobDetail, Trigger, and Scheduler. The scheduler can use Spring beans as job arguments through SchedulerFactoryBean.setJobFactory(SpringBeanJobFactory).
  • JavaMail — A simple MailSender interface plus a JavaMail-backed implementation; produces multipart mails via MimeMessageHelper.
  • Caffeine / JCache — Implementations of org.springframework.cache.CacheManager for the @Cacheable annotation system.
  • FreeMarkerFreeMarkerConfigurationFactoryBean configures a Configuration instance for template loading; used by both spring-webmvc and spring-webflux view resolvers.

Integration points

  • Depends on spring-beans, spring-context, spring-core.
  • Optional dependencies on Quartz, JavaMail, Caffeine, JCache API.
  • Most users pick one or two of these features; the entire module is rarely used end-to-end.

Entry points for modification

  • Add a new integration — If a library doesn't fit spring-jms/spring-orm/etc., this module is a reasonable home.
  • In practice — most new third-party integrations live in their own Spring projects (e.g., spring-data-redis for cache-on-Redis), so this module is unlikely to grow much.

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

spring-context-support – Spring Framework wiki | Factory