How toss/cache works
This deprecated Kotlin/JVM library provides configurable key-value and multi-field caches, with in-memory or Redis-backed resources, plus Spring MVC response caching. The main paths are application calls through CacheManager into cache implementations and repositories, or HTTP requests through the response filter and cache command. The graph reflects explicit SOURCE INDEX references and the sampled filter, manager, repository, and cache implementation excerpts; unsampled subsystem details are represented conservatively.
Main entry points: CacheManager.kt Cache manager · ResponseCacheFilter.kt Response cache filter · MultiFieldCacheImpl.kt Multi-field cache · CacheResources.kt Resource providers
Components 25
Cache API
- Cache manager
cache-core/src/main/kotlin/im/toss/util/cache/CacheManager.kt - Cache interfaces
cache-core/src/main/kotlin/im/toss/util/cache/Cache.kt - Modes and options
cache-core/src/main/kotlin/im/toss/util/cache/CacheOptions.kt - Value loaders
cache-core/src/main/kotlin/im/toss/util/cache/CacheValueLoader.kt
Cache Engine
- Key-value cache
cache-core/src/main/kotlin/im/toss/util/cache/impl/KeyValueCacheImpl.kt - Multi-field cache
cache-core/src/main/kotlin/im/toss/util/cache/impl/MultiFieldCacheImpl.kt - Blocking adapters
cache-core/src/main/kotlin/im/toss/util/cache/blocking/BlockingMultiFieldCache.kt - Mutex locking
cache-core/src/main/kotlin/im/toss/util/concurrent/lock/MutexLock.kt
Storage and Encoding
- Resource providers
cache-core/src/main/kotlin/im/toss/util/cache/CacheResources.kt - Repository interfaces
cache-core/src/main/kotlin/im/toss/util/repository/KeyFieldValueRepository.kt - In-memory store
cache-core/src/main/kotlin/im/toss/util/repository/InMemoryRepository.kt - Redis repositories
cache-core/src/main/kotlin/im/toss/util/repository/RedisKeyFieldValueRepository.kt - Serialization
cache-core/src/main/kotlin/im/toss/util/data/serializer/Serializer.kt - Packed payloads
cache-core/src/main/kotlin/im/toss/util/data/container/Pack.kt
Spring Integrations
- Spring configuration
cache-spring/src/main/kotlin/im/toss/util/cache/spring/TossCacheConfiguration.kt - MVC cache enablement
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/EnableCacheSupport.kt - HTTP client
- Response cache filter
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheFilter.kt - Servlet handler
- Response capture
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/CaptureHttpServletResponse.kt - Response cache command
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/CacheCommand.kt - Cache eviction
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/EvictCache.kt - Request identifiers
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/HttpServletRequestCacheIdentifier.kt - Response cache support
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheSupport.kt
Other components
- Kotlin application
Connections 25
- Kotlin application → Cache manager: requests caches
cache-core/src/main/kotlin/im/toss/util/cache/CacheManager.kt - Cache manager → Key-value cache: creates
cache-core/src/main/kotlin/im/toss/util/cache/CacheManager.kt - Cache manager → Multi-field cache: creates
cache-core/src/main/kotlin/im/toss/util/cache/CacheManager.kt - Cache manager → Resource providers: selects resources
cache-core/src/main/kotlin/im/toss/util/cache/CacheManager.kt - Cache manager → Modes and options: configures
cache-core/src/main/kotlin/im/toss/util/cache/CacheManager.kt - Cache manager → Cache interfaces: returns cache
cache-core/src/main/kotlin/im/toss/util/cache/CacheManager.kt - Multi-field cache → Repository interfaces: reads and writes
cache-core/src/main/kotlin/im/toss/util/cache/impl/MultiFieldCacheImpl.kt - Multi-field cache → Mutex locking: acquires locks
cache-core/src/main/kotlin/im/toss/util/cache/impl/MultiFieldCacheImpl.kt - Multi-field cache → Serialization: serializes values
cache-core/src/main/kotlin/im/toss/util/cache/impl/MultiFieldCacheImpl.kt - Cache interfaces → Value loaders: accepts loaders
- Blocking adapters → Cache interfaces: adapts
cache-core/src/main/kotlin/im/toss/util/cache/blocking/BlockingMultiFieldCache.kt - Resource providers → Redis repositories: provides Redis access
- Resource providers → In-memory store: provides in-memory access
- Spring configuration → Cache manager: configures
cache-spring/src/main/kotlin/im/toss/util/cache/spring/TossCacheConfiguration.kt - MVC cache enablement → Spring configuration: enables
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/EnableCacheSupport.kt - HTTP client → Response cache filter: sends request
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheFilter.kt - Response cache filter → Response capture: wraps response
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheFilter.kt - Response cache filter → Servlet handler: dispatches request
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheFilter.kt - Response cache filter → Response cache command: loads cached response
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheFilter.kt - Response cache filter → Packed payloads: packs response
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheFilter.kt - Response cache command → Blocking adapters: uses loader
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/CacheCommand.kt - Response cache command → Packed payloads: stores payload
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/CacheCommand.kt - Cache eviction → Cache manager: evicts entries
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/EvictCache.kt - Response cache support → Cache manager: uses cache manager
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheSupport.kt - Response cache support → Packed payloads: uses packed data
cache-spring-webmvc/src/main/kotlin/im/toss/util/cache/spring/webmvc/ResponseCacheSupport.kt