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

com.github.zhengframework.cache.noop.NoOpCacheModule Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
package com.github.zhengframework.cache.noop;

import com.google.inject.AbstractModule;
import javax.cache.CacheManager;
import javax.cache.Caching;
import javax.cache.annotation.CacheResolverFactory;
import javax.cache.spi.CachingProvider;
import org.jsr107.ri.annotations.DefaultCacheResolverFactory;

public class NoOpCacheModule extends AbstractModule {

  @Override
  protected void configure() {
    CachingProvider cachingProvider =
        Caching.getCachingProvider(NoOpCachingProvider.class.getName());
    CacheManager cacheManager = cachingProvider.getCacheManager();
    bind(CacheResolverFactory.class).toInstance(new DefaultCacheResolverFactory(cacheManager));
    bind(CacheManager.class).toInstance(cacheManager);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy