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