Skip to Content
Former Member
Sep 25, 2006 at 01:46 PM

Run something once in a cluster environment


I'm looking at using JBoss Cache to cache a large amount of data. If you're unfamiliar with JC, it's a cachine system that will synchronize multiple remote caches in a clustered environment. However, I don't want each cache to load itself at cluster startup, and then sync with all the other caches - there's a lot of data, and I don't want all the caches to become really chatty during startup for performance reasons. I would rather have one server instance act as the master cache, and then have it sync all the other empty caches...

I therefore need a way to determine what node in the cluster I'm running on. How can I programatically do this? I've looked through the API's, but it's like trying to find a needle in a haystack...