/hazelcast-documentation/src/main/docbook/manual/content/spring/SpringCache.xml
https://bitbucket.org/gabral6_gmailcom/hazelcast · XML · 46 lines · 26 code · 5 blank · 15 comment · 0 complexity · 1b62b805bfde4c52d54085b4b54397a5 MD5 · raw file
- <?xml version='1.0' encoding='UTF-8'?>
- <!--
- ~ Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
- <sect1 xml:id="SpringCache" version="5.0" xmlns="http://docbook.org/ns/docbook"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd
- http://www.w3.org/1999/xlink http://www.w3.org/1999/xlink.xsd">
- <title>Spring Cache</title>
- <para>
- As of version 3.1, Spring Framework provides support for adding caching into an existing Spring application.
- To use Hazelcast as Spring cache provider, you should just define a <code>com.hazelcast.spring.cache.HazelcastCacheManager</code>
- bean and register it as Spring cache manager.
- <programlisting language="xml"><![CDATA[<cache:annotation-driven cache-manager="cacheManager" />
- <hz:hazelcast id="hazelcast">
- ...
- </hz:hazelcast>
- <bean id="cacheManager" class="com.hazelcast.spring.cache.HazelcastCacheManager">
- <constructor-arg ref="instance"/>
- </bean>
- ]]></programlisting>
- <emphasis role="italic">For more info see
- <link xlink:href="http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/cache.html">
- Spring Cache Abstraction
- </link>.</emphasis>
- </para>
- </sect1>