public void processStoredValue(final TimestampedValue value) { if (!copyOnRead) { ((SerializedEntry) value).nullByteArray(); } }
public void processStoredValue(final TimestampedValue value) { ((SerializedEntry) value).nullByteArray(); }
public synchronized T getDeserializedValue(final SerializationStrategy<T> strategy) throws IOException, ClassNotFoundException { if (cached == null) { cached = strategy.deserialize(getValue()); nullByteArray(); } return cached; }
public synchronized T getDeserializedValue(final SerializationStrategy<T> strategy, ClassLoader classLoader) throws IOException, ClassNotFoundException { if (cached == null) { cached = strategy.deserialize(getValue(), classLoader); nullByteArray(); } return cached; }
/** * 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 synchronized T getDeserializedValue(final SerializationStrategy<T> strategy) throws IOException, ClassNotFoundException { if (this.cached == null) { this.cached = strategy.deserialize(getValue()); nullByteArray(); } return this.cached; }
/** * 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 synchronized T getDeserializedValue(final SerializationStrategy<T> strategy) throws IOException, ClassNotFoundException { if (this.cached == null) { this.cached = strategy.deserialize(getValue()); nullByteArray(); } return this.cached; }
/** * Return a copy of this entry, potentially reusing a cached copy, using the specified classloader if required. * * @param strategy deserialization strategy * @param classLoader loader to use during deserialization * @return a newly deserialized entry * @throws IOException if de-serialization fails * @throws ClassNotFoundException if a necessary class definition is missing */ public synchronized T getDeserializedValue(final SerializationStrategy<T> strategy, final ClassLoader classLoader) throws IOException, ClassNotFoundException { if (this.cached == null) { this.cached = strategy.deserialize(getValue(), classLoader); nullByteArray(); } return this.cached; }
/** * Return a copy of this entry, potentially reusing a cached copy, using the specified classloader if required. * * @param strategy deserialization strategy * @param classLoader loader to use during deserialization * @return a newly deserialized entry * @throws IOException if de-serialization fails * @throws ClassNotFoundException if a necessary class definition is missing */ public synchronized T getDeserializedValue(final SerializationStrategy<T> strategy, final ClassLoader classLoader) throws IOException, ClassNotFoundException { if (this.cached == null) { this.cached = strategy.deserialize(getValue(), classLoader); nullByteArray(); } return this.cached; }
public void put(final Object key, final Object value) throws CacheException { if (!isEnabled()) { return; } byte[] data; try { data = serializationStrategy.serialize(value); } catch (Exception e) { throw new CacheException(e); } String sKey = generateStringKeyFor(key); SerializedEntry entry = new SerializedEntry(value, data, store.getTimeSource()); store.putNoReturn(sKey, entry); // Now that the entry is shared we can drop the byte[] entry.nullByteArray(); }