Program1 writes to the cache and reads from it too. Program2 should be able to use the cache as read only. Both programs will be running on the same machine. Can I use Java Caching Service to accomplish this?
You need a so called "distributed cache". Possible products for that would be infinispan or hazelcast.