All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ebeaninternal.server.cache.DefaultCacheAdapter Maven / Gradle / Ivy

There is a newer version: 15.8.1
Show newest version
package io.ebeaninternal.server.cache;

import io.ebean.cache.ServerCache;
import io.ebean.cache.ServerCacheManager;

/**
 * Adapts SpiCacheManager to ServerCacheManager.
 * 

* Used to hide the Supplier part of the SpiCacheManager API from public use. *

*/ public class DefaultCacheAdapter implements ServerCacheManager { private final SpiCacheManager cacheManager; public DefaultCacheAdapter(SpiCacheManager cacheManager) { this.cacheManager = cacheManager; } @Override public boolean isLocalL2Caching() { return cacheManager.isLocalL2Caching(); } @Override public ServerCache getNaturalKeyCache(Class beanType) { return cacheManager.getNaturalKeyCache(beanType).get(); } @Override public ServerCache getBeanCache(Class beanType) { return cacheManager.getBeanCache(beanType).get(); } @Override public ServerCache getCollectionIdsCache(Class beanType, String propertyName) { return cacheManager.getCollectionIdsCache(beanType, propertyName).get(); } @Override public ServerCache getQueryCache(Class beanType) { return cacheManager.getQueryCache(beanType).get(); } @Override public void clear(Class beanType) { cacheManager.getBeanCache(beanType).get().clear(); cacheManager.getQueryCache(beanType).get().clear(); } @Override public void clearAll() { cacheManager.clearAll(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy