Skip to content

Commit

Permalink
Create cache service in autoconfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
aint committed Mar 16, 2019
1 parent 981ba69 commit 663b9e4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.github.aint.octopus;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
Expand All @@ -10,6 +12,12 @@
@ComponentScan(basePackageClasses = OctopusAutoConfiguration.class)
public class OctopusAutoConfiguration {

@Bean
@ConditionalOnBean(CacheManager.class)
public SpringCacheService springCacheService(CacheManager cacheManager) {
return new SpringCacheService(cacheManager);
}

@Bean
public IntegrationService integrationService(ApplicationPropertiesProvider propertiesProvider) {
String integrationPrefix = propertiesProvider
Expand Down

0 comments on commit 663b9e4

Please sign in to comment.