Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java @可缓存注释不适用于osgi蓝图_Java_Osgi_Ehcache_Apache Karaf_Blueprint Osgi - Fatal编程技术网

Java @可缓存注释不适用于osgi蓝图

Java @可缓存注释不适用于osgi蓝图,java,osgi,ehcache,apache-karaf,blueprint-osgi,Java,Osgi,Ehcache,Apache Karaf,Blueprint Osgi,使用Blueprint在OSGi容器中打开ehcache的正确方法是什么。要为非osgi、非blueprint项目启用ehcache,我们只需使用spring注释: org.springframework.cache.annotation.Cacheable java内部: @Cacheable public void method() { } 在xml配置中: <beans xmlns:cache="http://www.springframework.org/schema/cache

使用Blueprint在OSGi容器中打开ehcache的正确方法是什么。要为非osgi、非blueprint项目启用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/>
  ...

正如您已经提到的,一种方法是不使用spring,另一种方法是使用双子座蓝图,而不是现成的白羊座蓝图。双子座蓝图确实支持spring名称空间