1 of 1 people found this helpful
First step - since this seems like a new application that you're writing I'd suggest that you don't use JBoss Cache . JBC hasn't had any development going on it for at least a year or so now. All the new development is on Infinispan now. There is tonnes of documentation out there for you to go and read up on how to write up the application that you require using Infinispan.
Just out of interest, what's the reason that you decided to use JBoss Cache as opposed to Infinispan in the first place? Was it that you just haven't heard of it?
Thanks for the quick reply and your comments about infinispan.
Yes I have not heard of Infinispan.
I have to use JBoss Cache since the project I'm working started about 2 years back and at that time it was decided to use JBoss Cache. That's the only reason why I need to seek solutions for JBoss Cache. The code that I need to write is an extension to it.
I will definitely read on infinispan :).
How much work has been done on your project that uses JBoss Cache? Naturally people are reluctant to switch over onto a different system because they're lazy - but Infinispan does give you a TreeCache which has more or less the same API as JBC does so you can switch over easier than otherwise.
Just something to suggest to the other guys who work on your project that it's probably a good idea to try and make the switch over to Infinispan because that's where all the cool stuff is happening now.
Also if you don't mind me asking - I'm guessing from your name that you're Sri Lankan. Are you working on a project for a Sri Lankan company? If so, which one are you doing this for?
I'm now reading up on infinispan.
If you don't mind, could you please give me some examples for getting done what I need. Then I can think of migrating to this with the project approval.
Sorry, I'm unable to state the company details.
Thanks again Navin for your replies.
Ok, so you have a Cache set-up in a class with a main() method correct? And you have another app running in a different JVM that you need to talk to App 1 with the main method?
I'd probably do it as follows, and if any Infinispan guru's see me making a mistake then please point this out.
- Register your cache with a cache manager instance in app1.main()
- In app2 I would create a different cache manager instance and register the *same* cache with app2CacheManager.
That should do the trick and allow you to carry out any of the API methods on the cache. However, I think this might negate the need for any main method in app1.
Is this helpful?
But this says that I have two caches which are synchronized. And my second program deal with the cache in hand but since the synchronization happens I will be able to get the required data.
Thanks for the answer, but I'm seeking an option of directly communicating with the external cache. Ideal solution is to get an instance of the cache which was started by app1 and then directly performing get/put.
I may not be understanding your problem properly. I am on the #infinispan channel on FreeNode IRC. I have a feeling it would be a lot easier if we just spoke in real time and I can help you out where possible.
I think that if you have a CacheManager instance in each app with the same cache name (String) registered to each CM; your caches will be synchronised. This will work as long as long as you use the *same* configuration for each Cache instance.
But again, we could be barking up the wrong tree if I don't understand your problem properly. So, if you could find me on IRC would be great. I'm generally online from about 0900GMT up until 1800GMT roughly.