solar.module.cache
Class CachedObject

java.lang.Object
  |
  +--solar.module.cache.CachedObject
All Implemented Interfaces:
CacheConstants

public class CachedObject
extends java.lang.Object
implements CacheConstants

A container class for the object in the cache.

Version:
$Id: CachedObject.java,v 1.1 2003/10/04 01:49:26 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  long _created
          When created.
private  long _expires
          When it expires.
protected  java.lang.Object _id
          The id for cached object.
protected  java.lang.Object _obj
          The actual cached object.
private  boolean _stale
          Is this object stale/expired?
 
Fields inherited from interface solar.module.cache.CacheConstants
CACHE_CAPACITY_DEFAULT, CACHE_CAPACITY_INFINIT, CACHE_TTL_DEFAULT, CACHE_TTL_FOREVER
 
Constructor Summary
CachedObject(java.lang.Object id, java.lang.Object obj)
           
 
Method Summary
 long getCreated()
          Returns the creation time for the object.
 long getExpires()
          Returns the expiration time for the object.
 java.lang.Object getObject()
          Return the cached object.
 java.lang.Object getObjectId()
          Return the id of the cached object.
 boolean isStale()
          Is the object stale?
 void setCreated()
          Set the creation time.
 void setExpires(long expires)
          Set the expiration interval for the object.
 void setObject(java.lang.Object obj)
          Set the cached object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_id

protected java.lang.Object _id
The id for cached object.


_obj

protected java.lang.Object _obj
The actual cached object.


_created

protected long _created
When created.


_expires

private long _expires
When it expires.


_stale

private boolean _stale
Is this object stale/expired?

Constructor Detail

CachedObject

public CachedObject(java.lang.Object id,
                    java.lang.Object obj)
Method Detail

getObjectId

public java.lang.Object getObjectId()
Return the id of the cached object.


getObject

public java.lang.Object getObject()
Return the cached object.


setObject

public void setObject(java.lang.Object obj)
Set the cached object.


getCreated

public long getCreated()
Returns the creation time for the object.


setCreated

public void setCreated()
Set the creation time.


getExpires

public long getExpires()
Returns the expiration time for the object.


setExpires

public void setExpires(long expires)
Set the expiration interval for the object.


isStale

public boolean isStale()
Is the object stale?