My fork of airsonic with experimental fixes and improvements. See branch "custom"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
airsonic-custom/airsonic-main/src/main/java/org/airsonic/player/spring/EhcacheConfiguration.java

33 lines
868 B

package org.airsonic.player.spring;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.constructs.web.ShutdownListener;
import org.airsonic.player.cache.CacheFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.ServletContextListener;
@Configuration
public class EhcacheConfiguration {
@Bean
public ServletContextListener ehCacheShutdownListener() {
return new ShutdownListener();
}
@Bean
public Ehcache userCache(CacheFactory cacheFactory) {
return cacheFactory.getCache("userCache");
}
@Bean
public Ehcache mediaFileMemoryCache(CacheFactory cacheFactory) {
return cacheFactory.getCache("mediaFileMemoryCache");
}
@Bean
public CacheFactory cacheFactory() {
return new CacheFactory();
}
}