cache.select(new CachedObjectSelector<ScopedKey<?>, Object>() {
public boolean select(ScopedKey<?> selectedGlobalKey, ObjectCacheInfo<?> ocinfo) {
if (globalKey.getScope().equals(selectedGlobalKey.getScope())) {
Serializable selectedLocalKey = selectedGlobalKey.getKey();
if (selectedLocalKey instanceof OwnerKey) {
OwnerKey selectedOwnerKey = (OwnerKey) selectedLocalKey;
if (selectedOwnerKey.getType().equals(portalKey.getType())
&& selectedOwnerKey.getId().equals(portalKey.getId())) {
return true;
}
}
}
return false;