public static void startCache() {
   try {
     if (cache == null || cache.isClosed()) {
       cache = CacheFactory.create(ds);
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
 public static void closeCache() {
   try {
     if (cache != null && !cache.isClosed()) {
       cache.close();
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   try {
     if (ds != null) ds.disconnect();
   } catch (Exception e) {
     getLogWriter().fine("Error in disconnecting from Distributed System");
   }
 }