
driven-adapter.bin-stash.bin-stash-local-cache-config.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.binstash.config;
import co.com.bancolombia.binstash.model.api.ObjectCache;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
{{#include-local}}
import co.com.bancolombia.binstash.LocalCacheFactory;
{{/include-local}}
{{#include-centralized}}
import co.com.bancolombia.binstash.CentralizedCacheFactory;
{{/include-centralized}}
{{#include-hybrid}}
import co.com.bancolombia.binstash.HybridCacheFactory;
import co.com.bancolombia.binstash.model.SyncRule;
import java.util.Collections;
import java.util.List;
{{/include-hybrid}}
@Configuration
public class BinStashCacheConfig {
{{#include-local}}
@Bean
public ObjectCache objectCache(LocalCacheFactory localCacheFactory) {
return localCacheFactory.newObjectCache();
}
{{/include-local}}
{{#include-centralized}}
@Bean
public ObjectCache objectCache(CentralizedCacheFactory centralizedCacheFactory) {
return centralizedCacheFactory.newObjectCache();
}
{{/include-centralized}}
{{#include-hybrid}}
@Bean
public List cacheSyncRules() {
SyncRule simpleSyncRule = (keyArg, syncType) -> true;
return Collections.singletonList(simpleSyncRule);
}
@Bean
public ObjectCache objectCache(HybridCacheFactory cacheFactory,
List cacheSyncRules) {
return cacheFactory.newObjectCache(cacheSyncRules);
}
{{/include-hybrid}}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy