【问题标题】:@Cacheable annotation not working with osgi blueprint@Cacheable 注解不适用于 osgi 蓝图
【发布时间】:2014-08-12 22:59:33
【问题描述】:

什么是使用 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

【问题讨论】:

    标签: java osgi ehcache apache-karaf blueprint-osgi


    【解决方案1】:

    正如您已经提到的一种方法是不使用 spring,另一种方法是使用 Gemini-Blueprint 而不是 Out-Of-The-Box Aries Blueprint。 Gemini-Blueprint 确实支持 spring 命名空间。

    【讨论】:

      猜你喜欢
      • 2013-10-14
      • 1970-01-01
      • 1970-01-01
      • 2013-05-24
      • 2013-07-31
      • 2019-03-29
      • 1970-01-01
      • 2017-03-15
      • 2015-05-14
      相关资源
      最近更新 更多