@Override protected void createOrRetrieveCache() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Creating cache"); } // Get the existing cache if any try { this.cache = ClientCacheFactory.getAnyInstance(); } catch (CacheClosedException e) { } // If no cache exists, create one String message = null; if (this.cache == null || this.cache.isClosed()) { // enable pool subscription so that default cache can be used by hibernate module this.cache = new ClientCacheFactory(createDistributedSystemProperties()).create(); message = "Created "; } else { message = "Retrieved "; } getLogger().info(message + this.cache); }
public static ClientCache getClientCache() { try { return ClientCacheFactory.getAnyInstance(); } catch (CacheClosedException | IllegalStateException ignore) { return null; } }
public static ClientCache getClientCache() { try { return ClientCacheFactory.getAnyInstance(); } catch (CacheClosedException | IllegalStateException ignore) { return null; } }
public static boolean closeClientCache() { try { ClientCacheFactory.getAnyInstance().close(); return true; } catch (Exception ignore) { return false; } }
public static boolean closeClientCache() { try { ClientCacheFactory.getAnyInstance().close(); return true; } catch (Exception ignore) { return false; } }
@Override protected void createOrRetrieveCache() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Creating cache"); } // Get the existing cache if any try { this.cache = ClientCacheFactory.getAnyInstance(); } catch (CacheClosedException e) { } // If no cache exists, create one String message = null; if (this.cache == null || this.cache.isClosed()) { // enable pool subscription so that default cache can be used by hibernate module this.cache = new ClientCacheFactory(createDistributedSystemProperties()).create(); message = "Created "; } else { message = "Retrieved "; } getLogger().info(message + this.cache); }