Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Getting Started with Hazelcast

You're reading from  Getting Started with Hazelcast

Product type Book
Published in Aug 2013
Publisher
ISBN-13 9781782167303
Pages 136 pages
Edition 1st Edition
Languages
Author (1):
Matthew Johns Matthew Johns
Profile icon Matthew Johns

Table of Contents (18) Chapters

Getting Started with Hazelcast
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
What is Hazelcast? Getting off the Ground Going Concurrent Divide and Conquer Listening Out Spreading the Load Typical Deployments From the Outside Looking In Going Global Playing Well with Others Configuration Summary Index

Cacheable methods with the Spring cache


While the caching layer provided as part of Hibernate unlocks easy and convenient caching for high frequency or high cost data; but what about at a higher level and more generally, method calls can be expensive too.

Newer versions of the Spring framework (since version 3.1) features the ability to transparently cache method calls and their returned results, through the use of the com.hazelcast.spring.cache.HazelcastCacheManager class, and its registration as a Spring cache manager.

<cache:annotation-driven cache-manager="cacheManager" />

<bean id="cacheManager"
  class="com.hazelcast.spring.cache.HazelcastCacheManager">

  <constructor-arg ref="hzInstance"/>
</bean>

With this in place, we can then mark appropriate methods as @Cacheable and where required use @CacheEvict to trigger cache invalidations.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}