core/src/main/java/org/sakaiproject/nakamura/lite/CachingManagerImpl.java
protected void removeCached(String keySpace, String columnFamily, String key) throws StorageClientException {
        if (sharedCache != null) {
            // insert a replacement. This should cause an invalidation message
            // to propagate in the cluster.
            final String cacheKey = getCacheKey(keySpace, columnFamily, key);
            putToCacheInternal(cacheKey, new CacheHolder(null, managerId), false);
            LOGGER.debug("Marked as deleted in Cache {} ", cacheKey);
            if (client instanceof Disposer) {
                // we might want to change this to register the action as a
                // commit handler rather than a disposable.
                // it depends on if we think the delete is a transactional thing
                // or a operational cache thing.
                // at the moment, I am leaning towards an operational cache
                // thing, since regardless of if
                // the session commits or not, we want this to dispose when the
                // session is closed, or commits.
                ((Disposer) client).registerDisposable(new Disposable() {

                    @Override
                    public void setDisposer(Disposer disposer) {
                    }

                    @Override
                    public void close() {
                        CacheHolder ch = sharedCache.get(cacheKey);
                        if (ch != null && ch.wasLockedTo(managerId)) {
                            sharedCache.remove(cacheKey);
                            LOGGER.debug("Removed deleted marker from Cache {} ", cacheKey);
                        }
                    }
                });
            }
        }
        client.remove(keySpace, columnFamily, key);

    }
protected void removeCached(String keySpace, String columnFamily, String key) throws StorageClientException {
        if (sharedCache != null) {
            // insert a replacement. This should cause an invalidation message
            // to propagate in the cluster.
            final String cacheKey = getCacheKey(keySpace, columnFamily, key);
            putToCacheInternal(cacheKey, new CacheHolder(null, managerId), false);
            LOGGER.debug("Marked as deleted in Cache {} ", cacheKey);
            if (client instanceof Disposer) {
                // we might want to change this to register the action as a
                // commit handler rather than a disposable.
                // it depends on if we think the delete is a transactional thing
                // or a operational cache thing.
                // at the moment, I am leaning towards an operational cache
                // thing, since regardless of if
                // the session commits or not, we want this to dispose when the
                // session is closed, or commits.
                ((Disposer) client).registerDisposable(new Disposable() {

                    @Override
                    public void setDisposer(Disposer disposer) {
                    }

                    @Override
                    public void close() {
                        CacheHolder ch = sharedCache.get(cacheKey);
                        if (ch != null && ch.wasLockedTo(managerId)) {
                            sharedCache.remove(cacheKey);
                            LOGGER.debug("Removed deleted marker from Cache {} ", cacheKey);
                        }
                    }
                });
            }
        }
        client.remove(keySpace, columnFamily, key);

    }
Remove this object from the cache. Note, StorageClient uses the word
remove to mean delete. This method should do the same.

@param keySpace
@param columnFamily
@param key
@throws StorageClientException