什么是使用 Blueprint 在 OSGi 容器内打开 ehcache 的正确方法。要为非 osgi、非蓝图项目打开 ehcache,我们只需使用 spring 注释:
org.springframework.cache.annotation.Cacheable
内部java:
@Cacheable
public void method() {
}
在xml配置中:
<beans xmlns:cache="http://www.springframework.org/schema/cache"
<cache:annotation-driven/>
...
不幸的是,在 OSGi 和 Blueprint 中并非如此,因为我们不能将 Blueprint 与 Spring 混合使用。我已经尝试过,但没有找到命名空间处理程序的异常。@Cacheable 注释是否可以做到这一点,或者我们是否应该在没有弹簧支持的情况下尝试使用 ehcache?
我使用 Karaf 2.3.0.redhat-610379,JBoss Fuse 6.1.0