/** * Removes all from the region. Wraps the removeAll in event logs. * <p> * @throws IOException */ protected final void removeAllWithEventLogging() throws IOException { ICacheEvent<String> cacheEvent = createICacheEvent( getCacheName(), "all", ICacheEventLogger.REMOVEALL_EVENT ); try { processRemoveAll(); } finally { logICacheEvent( cacheEvent ); } }
/** * Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie. * * @throws IOException */ @Override public void dispose() throws IOException { disposeWithEventLogging(); }
/** * Get a value from the persistent store. * * Before the event logging layer, the subclasses implemented the do* methods. Now the do* * methods call the *EventLogging method on the super. The *WithEventLogging methods call the * abstract process* methods. The children implement the process methods. * * @param pattern Used to match keys. * @return A map of matches.. * @throws IOException */ protected final Map<K, ICacheElement<K, V>> doGetMatching( String pattern ) throws IOException { return super.getMatchingWithEventLogging( pattern ); }
/** * Puts an item into the cache. Wrapped in logging. * * @param cacheElement * @throws IOException */ protected final void updateWithEventLogging( ICacheElement<K, V> cacheElement ) throws IOException { ICacheEvent<K> cacheEvent = createICacheEvent( cacheElement, ICacheEventLogger.UPDATE_EVENT ); try { processUpdate( cacheElement ); } finally { logICacheEvent( cacheEvent ); } }
/** * Gets mmatching items from the cache based on the given pattern. * <p> * @param pattern * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data matching the pattern. * @throws IOException */ protected final Map<K, ICacheElement<K, V>> getMatchingWithEventLogging( String pattern ) throws IOException { ICacheEvent<String> cacheEvent = createICacheEvent( getCacheName(), pattern, ICacheEventLogger.GETMATCHING_EVENT ); try { return processGetMatching( pattern ); } finally { logICacheEvent( cacheEvent ); } }
/** * Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie. * Wraps the removeAll in event logs. * * @throws IOException */ protected final void disposeWithEventLogging() throws IOException { ICacheEvent<String> cacheEvent = createICacheEvent( getCacheName(), "none", ICacheEventLogger.DISPOSE_EVENT ); try { processDispose(); } finally { logICacheEvent( cacheEvent ); } }
/** * Gets the item from the cache. Wrapped in logging. * * @param key * @return ICacheElement, a wrapper around the key, value, and attributes * @throws IOException */ protected final ICacheElement<K, V> getWithEventLogging( K key ) throws IOException { ICacheEvent<K> cacheEvent = createICacheEvent( getCacheName(), key, ICacheEventLogger.GET_EVENT ); try { return processGet( key ); } finally { logICacheEvent( cacheEvent ); } }
/** * Gets multiple items from the cache based on the given set of keys. * * @param keys * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache for any of these keys * @throws IOException */ protected final Map<K, ICacheElement<K, V>> getMultipleWithEventLogging(Set<K> keys ) throws IOException { ICacheEvent<Serializable> cacheEvent = createICacheEvent( getCacheName(), (Serializable) keys, ICacheEventLogger.GETMULTIPLE_EVENT ); try { return processGetMultiple( keys ); } finally { logICacheEvent( cacheEvent ); } }
/** * Removes the item from the cache. Wraps the remove in event logs. * <p> * @param key * @return boolean, whether or not the item was removed * @throws IOException */ protected final boolean removeWithEventLogging( K key ) throws IOException { ICacheEvent<K> cacheEvent = createICacheEvent( getCacheName(), key, ICacheEventLogger.REMOVE_EVENT ); try { return processRemove( key ); } finally { logICacheEvent( cacheEvent ); } }
/** * Gets the item from the cache. * <p> * @param key * @return ICacheElement, a wrapper around the key, value, and attributes * @throws IOException */ @Override public ICacheElement<K, V> get( K key ) throws IOException { return getWithEventLogging( key ); }
/** * Gets multiple items from the cache based on the given set of keys. * * @param keys * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache for any of these keys * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> getMultiple(Set<K> keys) throws IOException { return getMultipleWithEventLogging( keys ); }
/** * Gets mmatching items from the cache based on the given pattern. * * @param pattern * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data matching the pattern. * @throws IOException */ protected final Map<K, ICacheElement<K, V>> getMatchingWithEventLogging( String pattern ) throws IOException { ICacheEvent<String> cacheEvent = createICacheEvent( getCacheName(), pattern, ICacheEventLogger.GETMATCHING_EVENT ); try { return processGetMatching( pattern ); } finally { logICacheEvent( cacheEvent ); } }
/** * Synchronously dispose the remote cache; if failed, replace the remote handle with a zombie. * Wraps the removeAll in event logs. * <p> * @throws IOException */ protected final void disposeWithEventLogging() throws IOException { ICacheEvent<String> cacheEvent = createICacheEvent( getCacheName(), "none", ICacheEventLogger.DISPOSE_EVENT ); try { processDispose(); } finally { logICacheEvent( cacheEvent ); } }
/** * Gets the item from the cache. Wrapped in logging. * <p> * @param key * @return ICacheElement, a wrapper around the key, value, and attributes * @throws IOException */ protected final ICacheElement<K, V> getWithEventLogging( K key ) throws IOException { ICacheEvent<K> cacheEvent = createICacheEvent( getCacheName(), key, ICacheEventLogger.GET_EVENT ); try { return processGet( key ); } finally { logICacheEvent( cacheEvent ); } }
/** * Gets multiple items from the cache based on the given set of keys. * <p> * @param keys * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache for any of these keys * @throws IOException */ protected final Map<K, ICacheElement<K, V>> getMultipleWithEventLogging(Set<K> keys ) throws IOException { ICacheEvent<Serializable> cacheEvent = createICacheEvent( getCacheName(), (Serializable) keys, ICacheEventLogger.GETMULTIPLE_EVENT ); try { return processGetMultiple( keys ); } finally { logICacheEvent( cacheEvent ); } }
/** * Removes the item from the cache. Wraps the remove in event logs. * * @param key * @return boolean, whether or not the item was removed * @throws IOException */ protected final boolean removeWithEventLogging( K key ) throws IOException { ICacheEvent<K> cacheEvent = createICacheEvent( getCacheName(), key, ICacheEventLogger.REMOVE_EVENT ); try { return processRemove( key ); } finally { logICacheEvent( cacheEvent ); } }
/** * Puts an item into the cache. Wrapped in logging. * <p> * @param cacheElement * @throws IOException */ protected final void updateWithEventLogging( ICacheElement<K, V> cacheElement ) throws IOException { ICacheEvent<K> cacheEvent = createICacheEvent( cacheElement, ICacheEventLogger.UPDATE_EVENT ); try { processUpdate( cacheElement ); } finally { logICacheEvent( cacheEvent ); } }
/** * Get a value from the persistent store. * * Before the event logging layer, the subclasses implemented the do* methods. Now the do* * methods call the *EventLogging method on the super. The *WithEventLogging methods call the * abstract process* methods. The children implement the process methods. * * @param key Key to locate value for. * @return An object matching key, or null. * @throws IOException */ protected final ICacheElement<K, V> doGet( K key ) throws IOException { return super.getWithEventLogging( key ); }