/** * Return a copy of this entry, potentially reusing a cached copy. * * @param strategy deserialization strategy * @return a newly deserialized entry * @throws IOException if de-serialization fails * @throws ClassNotFoundException if a necessary class definition is missing */ public T getDeserializedValue(final SerializationStrategy<T> strategy) throws IOException, ClassNotFoundException { return getDeserializedValue(strategy, null); }
public Element createElement(final Object key, final TimestampedValue value) { if (null == value) { return null; } SerializedEntry<AbstractElementData> entry = (SerializedEntry<AbstractElementData>) value; AbstractElementData data; try { if (copyOnRead) { data = entry.getDeserializedValueCopy(serializationStrategy, threadContextAwareClassLoader); } else { data = entry.getDeserializedValue(serializationStrategy, threadContextAwareClassLoader); } } catch (Exception e) { throw new CacheException(e); } Element element = data.createElement(key); element.setElementEvictionData(new ClusteredElementEvictionData(store, value)); return element; }
/** * Returns the unwrapped SerializedEntry if the reference is non-null. * * @param entry retrieved reference * @return unwrapped Object or null */ private static Object unwrap(final SerializedEntry entry, final SerializationStrategy serializationStrategy) { if (entry == null) { return null; } else { try { return entry.getDeserializedValue(serializationStrategy); } catch (Exception e) { throw new CacheException(e); } } }
public Element createElement(final Object key, final TimestampedValue value) { if (null == value) { return null; } SerializedEntry<AbstractElementData> entry = (SerializedEntry<AbstractElementData>) value; AbstractElementData data; try { data = entry.getDeserializedValue(store.getSerializationStrategy(), threadContextAwareClassLoader); } catch (Exception e) { throw new CacheException(e); } Element element = data.createElement(key); element.setElementEvictionData(new ClusteredElementEvictionData(store, value)); return element; } }