We are storing the auth token in the JCS, on restarting the server, the cache context got lost. In order to over come this, when stopping the server, decided to store the JCS list of values in to a file and When restarted, read the file and store it back to JCS. Please help me to store the JCS cache list in to file or any other possible solution.
I can't change the correct implementation of going out of storing the token in cache.
cache = JCS.getInstance("uniqueKey");
if (cache.get(key) == null) {
cache.put(key, value);
}