JBossCache的Spring配置

我正在尝试使用Spring配置文件配置JBossCache实例(最终在Tomcat中使用)。我没有看到任何在线示例,并试图找出样本JBoss Microcontainer格式和Spring IoC之间的映射。 有没有人有JBoss Cache的Spring配置示例?     
已邀请:
JBossCache(v3,无论如何)的一个非常吸引人的方面是API主要由符合JavaBean的类组成。这使得它们很容易在Spring中连线。 JBoss MicroContainer格式没有做任何特殊的事情,它都是POJO setter和构造函数注入。因此,不要试图将JBossMC语法转换为Spring,而只需直接查看类本身。 JBossCache文档还包含大量编程配置示例。 这是我的应用程序中使用Spring3
@Bean
样式配置的示例。它很容易转换成XML synyax,但这更好:
@Bean(destroyMethod="stop")
public <K,V> Cache<K, V> csiCache() {
    org.jboss.cache.config.Configuration cacheConfiguration = new org.jboss.cache.config.Configuration();

    cacheConfiguration.setCacheMode(CacheMode.REPL_ASYNC);
    cacheConfiguration.setTransactionManagerLookupClass(JBossTransactionManagerLookup.class.getName());
    cacheConfiguration.setClusterName(cacheClusterName);
    cacheConfiguration.setEvictionConfig(new EvictionConfig(new EvictionRegionConfig(
            Fqn.ROOT, new ExpirationAlgorithmConfig()
    )));

    return new DefaultCacheFactory<K, V>().createCache(cacheConfiguration, true);
}
    

要回复问题请先登录注册