org.datamanager.kernel
Class KernelMemory

java.lang.Object
  |
  +--org.datamanager.kernel.KernelMemory

public class KernelMemory
extends Object

This class will cooperate with SuaveEntityManger to manager the object in the memory of the knernel. It can provide the lookup capability for Entity, Proxy, Identifier. It also can find the oldest object reside in the memory

Author:
xi rao & bob

Field Summary
protected  Map entityToIdentifier
          A mapping from VerySimpleEntities to Identifiers.
static int HASHTABLE_LENGTH
          The maximum number of Entities cached in memory at a given time.
protected  Map identifierToEntity
          A mapping from Identifiers to VerySimpleEntities.
protected  Map identifierToProxy
          A mapping from Identifiers to EntityProxies.
protected  Map IdentifierToTimeStamp
           
protected  TreeMap timeStampToIdentifier
           
 
Constructor Summary
KernelMemory()
           
 
Method Summary
 int currentSize()
           
protected  Entity findEntity(org.datamanager.kernel.Identifier identifier)
           
 org.datamanager.kernel.Identifier findIdentifier(Entity entity)
           
 org.datamanager.kernel.Identifier findOldestIdentifier()
           
protected  org.datamanager.kernel.EntityProxy findProxy(org.datamanager.kernel.Identifier identifier)
           
 boolean isFull()
           
 void loadIntoMemory(org.datamanager.kernel.Identifier identifier, Entity entity, org.datamanager.kernel.EntityProxy entityProxy)
           
 int maxSize()
           
 Entity removeFromMemory(org.datamanager.kernel.Identifier identifier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HASHTABLE_LENGTH

public static final int HASHTABLE_LENGTH
The maximum number of Entities cached in memory at a given time.

See Also:
Constant Field Values

entityToIdentifier

protected Map entityToIdentifier
A mapping from VerySimpleEntities to Identifiers.


identifierToEntity

protected Map identifierToEntity
A mapping from Identifiers to VerySimpleEntities.


identifierToProxy

protected Map identifierToProxy
A mapping from Identifiers to EntityProxies.


timeStampToIdentifier

protected TreeMap timeStampToIdentifier

IdentifierToTimeStamp

protected Map IdentifierToTimeStamp
Constructor Detail

KernelMemory

public KernelMemory()
Method Detail

isFull

public boolean isFull()

loadIntoMemory

public void loadIntoMemory(org.datamanager.kernel.Identifier identifier,
                           Entity entity,
                           org.datamanager.kernel.EntityProxy entityProxy)
                    throws Exception
Exception

findOldestIdentifier

public org.datamanager.kernel.Identifier findOldestIdentifier()

removeFromMemory

public Entity removeFromMemory(org.datamanager.kernel.Identifier identifier)

currentSize

public int currentSize()

maxSize

public int maxSize()

findIdentifier

public org.datamanager.kernel.Identifier findIdentifier(Entity entity)

findProxy

protected org.datamanager.kernel.EntityProxy findProxy(org.datamanager.kernel.Identifier identifier)

findEntity

protected Entity findEntity(org.datamanager.kernel.Identifier identifier)


See the Helium Website