@SuppressWarnings("unchecked")
public Map invokeAll(Filter filter, EntryProcessor agent) {
if (adapter.isReadOnly(this)) {
adapter.beforeOperation(this);
EntryProcessor transformedAgent = adapter.transformProcessor(this, agent);
Filter transformedFilter = adapter.transformFilter(this, filter);
Map result = nestedCache.invokeAll(transformedFilter, transformedAgent);
adapter.afterOperation(this);
return result;
}
else {
adapter.beforeOperation(this);
EntryProcessor transformedAgent = adapter.transformProcessor(this, agent);
Filter transformedFilter = adapter.transformFilter(this, filter);
// all keys affected by processor should be marked as dirty in transaction
Collection keys = nestedCache.keySet(transformedFilter);
adapter.markDirty(this, keys);
Map result = nestedCache.invokeAll(keys, transformedAgent);
adapter.afterOperation(this);