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?