org.springframework.extensions.surf.cache
Class CacheItem<K>

java.lang.Object
  extended by org.springframework.extensions.surf.cache.CacheItem<K>
All Implemented Interfaces:
Serializable

public final class CacheItem<K>
extends Object
implements Serializable

Wraps the cached item with metadata

Author:
muzquiano
See Also:
Serialized Form

Constructor Summary
CacheItem(String key, K obj, long timeout)
          Instantiates a new cache item.
 
Method Summary
 boolean isExpired()
          Checks if is expired.
 void readObject(ObjectInputStream in)
          Deserializes the object from an input stream
 void writeObject(ObjectOutputStream out)
          Serializes the object to an output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheItem

public CacheItem(String key,
                 K obj,
                 long timeout)
Instantiates a new cache item.

Parameters:
key - the key
obj - the obj
timeout - the timeout
Method Detail

isExpired

public boolean isExpired()
Checks if is expired.

Returns:
true, if is expired

writeObject

public void writeObject(ObjectOutputStream out)
                 throws IOException
Serializes the object to an output stream

Parameters:
out - the out
Throws:
IOException - Signals that an I/O exception has occurred.

readObject

public void readObject(ObjectInputStream in)
                throws IOException,
                       ClassNotFoundException
Deserializes the object from an input stream

Parameters:
in - the in
Throws:
IOException - Signals that an I/O exception has occurred.
ClassNotFoundException - the class not found exception


Copyright © 2009 SpringSource, Inc. All Rights Reserved.