Created
August 25, 2012 13:09
CrossCacheEntryProcessor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("serial") | |
public class CrossCacheEntryProcessor implements EntryProcessor, PortableObject { | |
// the cache to be accessed | |
private String crossCache; | |
private static Log LOGGER = LogFactory.getLog(CrossCacheEntryProcessor.class); | |
// required for POF | |
public CrossCacheEntryProcessor() { | |
} | |
/** | |
* Creates a new cross cache entry processor by passing the name of the cache to | |
* access via direct backing map access | |
* | |
* @param crossCache | |
*/ | |
public CrossCacheEntryProcessor(String crossCache) { | |
this.crossCache = crossCache; | |
} | |
@SuppressWarnings("unused") | |
@Override | |
public Object process(Entry entry) { | |
LOGGER.debug("entry processor starting"); | |
BackingMapManagerContext mctx = ((BinaryEntry) entry).getContext(); | |
BackingMapContext ctx = mctx.getBackingMapContext(crossCache); | |
BinaryEntry otherEntry = (BinaryEntry) ctx.getBackingMapEntry(mctx.getKeyToInternalConverter().convert(1)); | |
LOGGER.debug("Entry processor ended"); | |
return null; | |
} | |
@Override | |
@SuppressWarnings("rawtypes") | |
public Map processAll(Set set) { | |
for (Object object : set) { | |
@SuppressWarnings("unused") | |
Entry e = (Entry) object; | |
} | |
return null; | |
} | |
@Override | |
public void readExternal(PofReader reader) throws IOException { | |
crossCache = reader.readString(0); | |
} | |
@Override | |
public void writeExternal(PofWriter writer) throws IOException { | |
writer.writeString(0, crossCache); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment