WowCoCacheAutoConfiguration

@Configuration(proxyBeanMethods = false)
class WowCoCacheAutoConfiguration

Shares the services' aggregate states through CoCache when the application runs CoCache (it has CoCache's CacheRuntime bean, which CoCache's starter gives with cocache.backend set). This module lists it in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports; its ordering (after CoCache's auto-configuration) is in META-INF/spring-autoconfigure-metadata.properties, so that it imports no Spring Boot type.

  • The readers: a lazy StateViewCache<V> bean of each state view the peer contracts on the class path name (StateViewCacheRegistrar), from the service's StateViewCaches, whose misses read through the node's QueryApi. Its caches are created at startup, through the starter's CoCacheFactory when the application has it, so CoCache's settings (cocache.defaults.cache.*, cocache.caches.[wow.<context>.<aggregate>].*) apply to them. They are created at startup even under spring.main.lazy-initialization (@Lazy(false)), so the starter's check that every cocache.caches.[name] names a cache, made once the singletons exist, finds them, and a name CoCache refuses fails the start rather than a first read. (CoCache's CacheNameContributor would only relax the check.)

  • The owner: for each aggregate type wow.cocache.publish lists, a sink subscription that writes its states after each commit (cocache-sink.<aggregate>, StateViewSink), which the node runs beside the application's.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun wowCoCacheSinks(caches: StateViewCaches, manifest: Manifest, environment: Environment, beanFactory: ConfigurableListableBeanFactory): PublishedSinks
Link copied to clipboard
@Bean
@Lazy(value = false)
fun wowStateViewCaches(runtime: CacheRuntime, factories: ObjectProvider<CoCacheFactory>, beanFactory: ConfigurableListableBeanFactory, queries: ObjectProvider<QueryApi>): StateViewCaches