Class LoomAutoConfiguration

java.lang.Object
com.loomcache.springboot.autoconfigure.LoomAutoConfiguration

@AutoConfiguration(beforeName="org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration") @EnableConfigurationProperties(LoomProperties.class) @Import(CacheNodeConfig.class) public class LoomAutoConfiguration extends Object
Spring Boot auto-configuration for LoomCache client and server.

Enables seamless integration with Spring Boot applications: - Automatically creates a Loom client bean configured from application.properties - Optionally creates an embedded CacheNode server if loomcache.server.enabled=true - Handles lifecycle with proper cleanup on shutdown

Configuration prefix: loomcache

  • Constructor Details

    • LoomAutoConfiguration

      public LoomAutoConfiguration()
  • Method Details

    • loomClient

      @Bean @ConditionalOnMissingBean(LoomCache.class) @Conditional(LoomClientEnabledCondition.class) public LoomCache loomClient(LoomProperties properties)
      Creates and connects a LoomCache client.
      Parameters:
      properties - Spring Boot configuration properties (must not be null)
      Returns:
      LoomCache client instance
      Throws:
      NullPointerException - if properties is null
    • loomCacheManager

      @Bean @ConditionalOnMissingBean(org.springframework.cache.CacheManager.class) @Conditional(LoomClientEnabledCondition.class) @ConditionalOnProperty(prefix="loomcache.spring-cache", name="enabled", havingValue="true", matchIfMissing=true) public LoomCacheManager loomCacheManager(LoomCache loomClient, LoomProperties properties)
      Creates a Spring CacheManager backed by LoomCache. Only registered if no other CacheManager bean exists.
      Parameters:
      loomClient - the LoomCache client instance
      properties - LoomCache configuration properties
      Returns:
      a LoomCacheManager backed by the distributed cache
    • loomHealthIndicator

      @Bean("loomcache") @ConditionalOnMissingBean(name="loomcache") public LoomHealthIndicator loomHealthIndicator(org.springframework.beans.factory.ObjectProvider<LoomCache> loomClientProvider, org.springframework.beans.factory.ObjectProvider<CacheNode> cacheNodeProvider)
    • shutdown

      @PreDestroy public void shutdown() throws Exception
      Graceful shutdown: close the LoomCache client. Server lifecycle is managed by CacheNodeConfig via @Bean(destroyMethod = "stop").
      Throws:
      Exception