/** * Removes all cached items. * * @throws IllegalStateException if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE} */ public void removeAll() throws IllegalStateException, CacheException { CacheTransactionHelper.beginTransactionIfNeeded(cache); try { cache.removeAll(); } finally { CacheTransactionHelper.commitTransactionIfNeeded(cache); } }
@Override public void removeAll() throws RemoteException, IllegalStateException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { super.removeAll(); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public boolean remove(Serializable key) throws RemoteException, IllegalStateException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.remove(key); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public Element getQuiet(Serializable key) throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.getQuiet(key); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public void put(Element element) throws RemoteException, IllegalArgumentException, IllegalStateException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { super.put(element); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public List getKeys() throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.getKeys(); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public List getElements(List keys) throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.getElements(keys); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public void send(List eventMessages) throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { super.send(eventMessages); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } } }
/** * {@inheritDoc} */ @Override public long getSize() { if (cache.getCacheConfiguration().isTerracottaClustered()) { return getRemoteSizeSample().getMostRecentSample().getCounterValue(); } CacheTransactionHelper.beginTransactionIfNeeded(cache); try { return cache.getStatistics().getSize(); } catch (RuntimeException e) { throw Utils.newPlainException(e); } finally { try { CacheTransactionHelper.commitTransactionIfNeeded(cache); } catch (RuntimeException re) { throw Utils.newPlainException(re); } } }
} finally { try { CacheTransactionHelper.commitTransactionIfNeeded(cache); } catch (RuntimeException e2) { throw Utils.newPlainException(e2);
/** * Removes all cached items. * * @throws IllegalStateException if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE} */ public void removeAll() throws IllegalStateException, CacheException { CacheTransactionHelper.beginTransactionIfNeeded(cache); try { cache.removeAll(); } finally { CacheTransactionHelper.commitTransactionIfNeeded(cache); } }
/** * Removes all cached items. * * @throws IllegalStateException if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE} */ public void removeAll() throws IllegalStateException, CacheException { CacheTransactionHelper.beginTransactionIfNeeded(cache); try { cache.removeAll(); } finally { CacheTransactionHelper.commitTransactionIfNeeded(cache); } }
/** * Removes all cached items. * * @throws IllegalStateException if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE} */ public void removeAll() throws IllegalStateException, CacheException { CacheTransactionHelper.beginTransactionIfNeeded(cache); try { cache.removeAll(); } finally { CacheTransactionHelper.commitTransactionIfNeeded(cache); } }
@Override public boolean remove(Serializable key) throws RemoteException, IllegalStateException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.remove(key); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public List getElements(List keys) throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.getElements(keys); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public Element getQuiet(Serializable key) throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.getQuiet(key); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public List getKeys() throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.getKeys(); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public void send(List eventMessages) throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { super.send(eventMessages); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } } }
@Override public Element getQuiet(Serializable key) throws RemoteException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { return super.getQuiet(key); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }
@Override public void put(Element element) throws RemoteException, IllegalArgumentException, IllegalStateException { boolean started = CacheTransactionHelper.isTransactionStarted(cache); if (!started) { CacheTransactionHelper.beginTransactionIfNeeded(cache); } try { super.put(element); } finally { if (!started) { CacheTransactionHelper.commitTransactionIfNeeded(cache); } } }