crafter.core.cache-context.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2007-2019 Crafter Software Corporation. All Rights Reserved.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Cache Store Adapter -->
<bean id="crafter.cacheStoreAdapter" class="org.craftercms.core.cache.impl.store.EhCacheStoreAdapter"/>
<bean id="crafter.cacheRefresher" class="org.craftercms.core.cache.impl.CacheRefresherImpl"/>
<bean id="crafter.cache" class="org.craftercms.core.cache.impl.CacheImpl">
<property name="cacheStoreAdapter" ref="crafter.cacheStoreAdapter"/>
<property name="cacheRefresher" ref="crafter.cacheRefresher"/>
</bean>
<!-- Cache Service -->
<bean id="crafter.cacheService" class="org.craftercms.core.service.impl.CacheServiceImpl">
<property name="cache" ref="crafter.cache"/>
</bean>
<!-- Cache Template -->
<bean id="crafter.cacheTemplate" class="org.craftercms.core.util.cache.impl.DefaultCacheTemplate">
<property name="cacheService" ref="crafter.cacheService" />
</bean>
<!-- Cache Ticker -->
<beans profile="crafter.core.activeCache">
<bean id="crafter.cacheTickerJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="crafter.cache"/>
<property name="targetMethod" value="tick"/>
<property name="concurrent" value="false"/>
</bean>
<bean id="crafter.cacheTickerTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
<property name="jobDetail" ref="crafter.cacheTickerJob"/>
<property name="startDelay" value="${crafter.core.cache.tick.frequency}" />
<property name="repeatInterval" value="${crafter.core.cache.tick.frequency}" />
</bean>
<bean id="crafter.cacheTickerScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
destroy-method="destroy">
<property name="triggers">
<list>
<ref bean="crafter.cacheTickerTrigger"/>
</list>
</property>
<property name="quartzProperties">
<props>
<prop key="org.quartz.threadPool.threadCount">1</prop>
</props>
</property>
</bean>
</beans>
</beans> © 2015 - 2025 Weber Informatics LLC | Privacy Policy