【发布时间】:2014-05-17 13:54:26
【问题描述】:
我在我的项目中使用 ehcache,所以当服务器启动时,少数表的数据将被加载到缓存中。在我的应用程序中,我使用的是 Spring、Hibernate、JSF 我在 applicationCONtext.xml 文件中使用此配置
<bean id="cacheManager" class="com.ccc.service.cache.CacheManager" init-method="init">
<property name="delay" value="${timer.delay}" />
</bean>
<bean id="companyCache" class="com.ccc.service.cache.clients.ValidCacheClient"/>
<context:component-scan base-package="com.ccc.spring" />
<context:annotation-config />
<context:spring-configured />
在 Jsf Managed Bean 中,我正在创建这样的服务对象类
@ManagedProperty(value = "#{GlobalDataService}")
static GlobalDataService globalDataService;
但是在ValidCacheClient.java中如何创建Service类的对象呢? ValidCacheClient.java 不是托管类,那么如何创建 Object of Service 类?
【问题讨论】: