PageRenderTime 15ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1<?xml version='1.0' encoding='UTF-8'?>
 2
 3<!--
 4  ~ Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
 5  ~
 6  ~ Licensed under the Apache License, Version 2.0 (the "License");
 7  ~ you may not use this file except in compliance with the License.
 8  ~ You may obtain a copy of the License at
 9  ~
10  ~ http://www.apache.org/licenses/LICENSE-2.0
11  ~
12  ~ Unless required by applicable law or agreed to in writing, software
13  ~ distributed under the License is distributed on an "AS IS" BASIS,
14  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ~ See the License for the specific language governing permissions and
16  ~ limitations under the License.
17  -->
18
19<sect1 xml:id="SpringCache" version="5.0" xmlns="http://docbook.org/ns/docbook"
20       xmlns:xi="http://www.w3.org/2001/XInclude"
21       xmlns:xlink="http://www.w3.org/1999/xlink"
22       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23       xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd
24       http://www.w3.org/1999/xlink http://www.w3.org/1999/xlink.xsd">
25    <title>Spring Cache</title>
26    <para>
27        As of version 3.1, Spring Framework provides support for adding caching into an existing Spring application.
28        To use Hazelcast as Spring cache provider, you should just define a <code>com.hazelcast.spring.cache.HazelcastCacheManager</code>
29        bean and register it as Spring cache manager.
30
31    <programlisting language="xml"><![CDATA[<cache:annotation-driven cache-manager="cacheManager" />
32
33<hz:hazelcast id="hazelcast">
34    ...
35</hz:hazelcast>
36
37<bean id="cacheManager" class="com.hazelcast.spring.cache.HazelcastCacheManager">
38    <constructor-arg ref="instance"/>
39</bean>
40]]></programlisting>
41    <emphasis role="italic">For more info see
42        <link xlink:href="http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/cache.html">
43            Spring Cache Abstraction
44        </link>.</emphasis>
45    </para>
46</sect1>