Skip navigation links
com.sigmadynamics.sdo.support
Class SDEntityCache
java.lang.Object
com.sigmadynamics.sdo.support.SDOBase
com.sigmadynamics.sdo.base.SDO
com.sigmadynamics.sdo.support.SDEntityCache
- All Implemented Interfaces:
- SDOInterface, EntityCacheInterface
- Direct Known Subclasses:
- EntityCache
-
public abstract class SDEntityCache
- extends SDO
- implements EntityCacheInterface
- Since:
- 1.0
Constructor Summary |
SDEntityCache(int entryLifeTime, int maxSize, long refreshPeriod, HasLong currentTimeMillis)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cache
protected final java.util.Map<EntityInterface,EntityDataInterface> cache
invalid
protected boolean invalid
entryLifeTime
protected final int entryLifeTime
- if non-positive, then entries don't individually expire
refreshTime
protected long refreshTime
- next scheduled refresh time (ms). -1 means not yet refreshed or scheduled. after app init, the generated cache code's postloadinit will set the refreshtime to now+refreshPeriod
refreshPeriod
protected final long refreshPeriod
- non-positive means cache age is entry based
SDEntityCache
public SDEntityCache(int entryLifeTime,
int maxSize,
long refreshPeriod,
HasLong currentTimeMillis)
-
- Parameters:
entryLifeTime
- lifetime of entry in seconds
maxSize
- maximum number of entries allowed in the cache
refreshPeriod
- milliseconds
- Since:
- 3.0
isValid
protected boolean isValid()
-
- Since:
- 1.0
reload
protected void reload()
-
- Since:
- 1.0
get
public EntityDataInterface get(EntityInterface entity)
-
- Specified by:
get
in interface EntityCacheInterface
-
- Since:
- 1.0
put
public void put(EntityDataInterface newEntityData)
-
- Specified by:
put
in interface EntityCacheInterface
-
- Since:
- 1.0
getRefreshTime
public long getRefreshTime()
-
- Returns:
- next scheduled refresh time (milliseconds)
- Since:
- 3.0
getCurrentSize
public int getCurrentSize()
-
- Since:
- 3.0
getEntryLifeTime
public int getEntryLifeTime()
-
- Returns:
- seconds. A non-positive value indicates that entries never expire.
- Since:
- 3.0
getMaxSize
public int getMaxSize()
-
- Since:
- 3.0
getRefreshPeriod
public long getRefreshPeriod()
-
- Returns:
- milliseconds. default value is 86400000, or 1 day. If a non-positive value is returned that means the refresh period is infinite. The cache is never refreshed as a whole.
- Since:
- 3.0
getGets
public long getGets()
-
- Since:
- 3.0
getHits
public long getHits()
-
- Since:
- 3.0
getMisses
public long getMisses()
-
- Since:
- 3.0
getPuts
public long getPuts()
-
- Since:
- 3.0
Skip navigation links
Copyright © 2010, Oracle. All rights reserved.