or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

annotation-config.mdaot.mdcaching.mdcontext-lifecycle.mdevents.mdformatting.mdi18n.mdindex.mdjmx.mdresilience.mdscheduling.mdstereotypes.mdvalidation.md
tile.json

index.mddocs/

Spring Context (org.springframework:spring-context)

Core Spring application context support for dependency injection, lifecycle management, and enterprise features.

Key Capabilities

  • Component Scanning: @ComponentScan, @Component, @Service, @Repository, @Controller annotations
  • Lifecycle Management: @PostConstruct, @PreDestroy, Lifecycle interfaces, application events
  • Scheduling: @Scheduled, @Async, @EnableScheduling, @EnableAsync
  • Caching: @Cacheable, @CacheEvict, @CachePut, @EnableCaching
  • Validation: @Validated, Validator interface, Bean Validation (JSR-380) integration
  • I18n: MessageSource, ResourceBundleMessageSource, LocaleContextHolder
  • JMX: @ManagedResource, @ManagedAttribute, @ManagedOperation
  • Formatting: @DateTimeFormat, @NumberFormat, Formatter API
  • Resilience: @Retryable, @ConcurrencyLimit (Spring 7.0+)
  • AOT: GraalVM native image support, ApplicationContextAotGenerator

Documentation

  • Component Scanning & Annotations - @Component, @ComponentScan, @Configuration
  • Stereotype Annotations - @Service, @Repository, @Controller
  • Context Lifecycle - Bean lifecycle, application events
  • Event System - @EventListener, ApplicationEventPublisher
  • Task Scheduling - @Scheduled, @Async, TaskScheduler, TaskExecutor
  • Caching - @Cacheable, @CacheEvict, @CachePut, CacheManager
  • Validation - Validator, @Validated, Bean Validation integration
  • Internationalization - MessageSource, ResourceBundleMessageSource
  • JMX Integration - @ManagedResource, @ManagedAttribute, @ManagedOperation
  • Formatting & Conversion - @DateTimeFormat, @NumberFormat, Formatter
  • Resilience Patterns - @Retryable, @ConcurrencyLimit (Spring 7.0+)
  • AOT Compilation - GraalVM native image, ApplicationContextAotGenerator

Maven Dependency

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>7.0.1</version>
</dependency>

Quick Start

@Configuration
@ComponentScan("com.example")
@EnableScheduling
@EnableAsync
@EnableCaching
public class AppConfig {

    @Bean
    public CacheManager cacheManager() {
        return new ConcurrentMapCacheManager("users");
    }
}

@Service
public class UserService {

    @Cacheable("users")
    public User getUser(Long id) {
        return userRepository.findById(id);
    }

    @Scheduled(fixedRate = 5000)
    public void scheduledTask() {
        // Runs every 5 seconds
    }

    @Async
    public CompletableFuture<String> asyncOperation() {
        return CompletableFuture.completedFuture("result");
    }
}