After my recent discovery of Hazelcast, I decided to update my caching aspect project to include a Hazelcast implementation.
The source code for this project is available here
For more information please refer to the actual source or my original Ehcache post. The main difference here is that the Hazelcast implementation is by default a distributed cache, and takes advantage of all the other functionality that Hazelcast provides.
The main points of interest for this implementation are:
- The actual aspect class. See code below.
- The application context. See xml below.
- The Hazelcast configuration. I am using the default Hazelcast configuration, located in the hazelcast-version.jar. To use a custom one, you can define a hazelcast.xml and inject it via Spring.
- The CacheKeyStrategy in the code below is an interface defined to allow key generation for the cache for specific requirements. There is a default implementation that simply sorts and uses hashcodes of the values in the class. You can define a strategy per type you want to cache.
note: java docs only removed for size of post
The aspect:
The application context:
The test case:
Subscribe to:
Post Comments (Atom)
Popular Posts
-
I have recently been slacking on content on my blog, between long stressful hours at work and to the wonderful toy that is an iPhone, I have...
-
I make no claim to be a "computer scientist" or a software "engineer", those titles alone can spark some debate, I regar...
-
I saw an article (well more of a rant) the other day, by Rob Williams Brain Drain in enterprise Dev . I have to say, I do agree with some o...
-
This series of posts will be about me getting to grips with JBoss Drools . The reasoning behind it is: SAP bought out my company's curre...
-
I recently finished 97 Things every programmer should know . Well to be completely honest I did skim over a couple of the 97, but all and al...
Any idea how this can be done using Guice?
ReplyDeleteHi, Guice require source-level access. If the annotation bothers you or you're using Guice to create objects. I found another advance tutorial here, you can see, http://beust.com/weblog/2012/08/21/advanced-dependency-injection-with-guice/
DeleteHowever I love this post also, really appreciate your work. Thanks from dragonflygames.co.uk -best free ios games
Mmmm... I have never used Guice, just did a quick search and a little bit of reading... I could probably slap it together tomorrow. From what I can see Guice is also using AopAlliance.. and their implementation will be very similar to my original Spring 2.x or even 1.X implementation. You will need to Implement MethodInterceptor ... and use a MethodInvocation object instead of ProceedingJoinPoint.
ReplyDeleteIf you don't come right, let me know.. shouldn't take long to adapt this version.
Gr8 article. Thx for sharing. I linked up your article from my blog. Hope you do not mind :)... Cheers.
ReplyDeleteDinuka
Thank you... and of course I don't mind.
ReplyDeleteAwesome coding ! really helpful.
ReplyDeleteForte School Children classes
play casino games online:
ReplyDeletehttps://www.oobbg.com
https://www.oobbg.com/theking
https://www.oobbg.com/sands
https://www.oobbg.com/first
https://www.oobbg.com/yes
https://www.oobbg.com/coin
https://www.oobbg.com/33
https://www.oobbg.com/world
https://www.oobbg.com/merit
https://www.oobbg.com/gatsby
https://www.omgka.com
https://www.omgka.com/theking
https://www.omgka.com/sands
https://www.omgka.com/first
https://www.omgka.com/yes
https://www.omgka.com/super
https://www.omgka.com/gatsby
https://www.omgka.com/33
https://www.omgka.com/world
https://www.omgka.com/merit
https://www.bbdd66.com
https://www.bbdd66.com/theking
https://www.bbdd66.com/sands
https://www.bbdd66.com/first
https://www.bbdd66.com/yes
https://www.bbdd66.com/super
https://www.bbdd66.com/gatsby
https://www.bbdd66.com/33
https://www.bbdd66.com/world
https://www.bbdd66.com/merit
https://www.omgab.com
https://www.omgab.com/theking
https://www.omgab.com/sands
https://www.omgab.com/first
https://www.omgab.com/yes
https://www.omgab.com/super
https://www.omgab.com/gatsby
https://www.omgab.com/33
https://www.omgab.com/world
https://www.omgab.com/merit
https://www.omgqq.com
https://www.omgqq.com/thekingcasino
https://www.omgqq.com/sandscasino
https://www.omgqq.com/firstcasino
https://www.omgqq.com/yescasino
https://www.omgqq.com/supercasino
https://www.omgqq.com/gatsbycasino
https://www.omgqq.com/33casino
https://www.omgqq.com/worldcasino
https://www.omgqq.com/merit
https://www.omcyy.com 우리카지노사이트
ReplyDeletehttps://www.omcyy.com/thekingcasino 더킹카지노
https://www.omcyy.com/sandscasino 샌즈카지노
https://www.omcyy.com/firstcasino 퍼스트카지노
https://www.omcyy.com/yescasino 예스카지노
https://www.omcyy.com/supercasino 슈퍼카지노
https://www.omcyy.com/gatsbycasino 개츠비카지노
https://www.omcyy.com/33casino 33카지노
https://www.omcyy.com/worldcasino 월드카지노
https://www.omcyy.com/merit 메리트카지노
Mua vé tại Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ tháng nào rẻ nhất
vé máy bay từ mỹ về việt nam hãng korea
giá vé máy bay từ Toronto đến việt nam
bán vé máy bay từ nhật về việt nam
Giá vé máy bay Hàn Việt Vietjet
Vé máy bay từ Đài Loan về VN
Chi phí cho chuyên gia nước ngoài