| java.lang.Object org.space4j.passivation.PassivationMap
PassivationMap | public class PassivationMap implements Map,Runnable,Serializable(Code) | | The PassivationMap stores its values in PassivationObjs.
It creates a PassivationObj for all objects it receives through the put method.
PassivationMap returns PassivationObjs through its get method.
It is able to passivate objects to save memory based on its last access time.
This will be useful when you have too many objects and there is not enough RAM.
Let's say you have 3 million registered users for your application.
It's not a good idea to keep all 3 million users in memory.
Among these 3 million users, how many are ACTIVE users ???
The goal of the PassivationMap is to keep only active objects in memory.
Note: Passivation does not generate commands and it is only reflected by snapshots.
|
PassivationMap | public PassivationMap(Space4J space4j)(Code) | | Creates a PassivationMap
Parameters: space4j - The space4j containing this map. |
PassivationMap | public PassivationMap(Space4J space4j, int sleeptime, int mininterval)(Code) | | Creates a PassivationMap with sleeptime and mininterval.
Parameters: space4j - The space4j containing this map. Parameters: sleeptime - The monitor will wake up every sleeptime. Parameters: mininterval - The min interval before an object can be passivated. |
PassivationMap | public PassivationMap(Space4J space4j, Map map)(Code) | | Creates a PassivationMap.
Parameters: space4j - The space4j containing this map. Parameters: map - The internal map to use. |
clear | public synchronized void clear()(Code) | | |
containsKey | public synchronized boolean containsKey(Object key)(Code) | | |
containsValue | public boolean containsValue(Object value)(Code) | | |
get | public synchronized Object get(Object key)(Code) | | This will only return PassivationObjs.
|
getSafeKeyIterator | public synchronized Iterator getSafeKeyIterator()(Code) | | Return a thread-safe Iterator with the keys of this Map.
Thread-safe iterator with keys. |
hashCode | public int hashCode()(Code) | | |
isEmpty | public synchronized boolean isEmpty()(Code) | | |
putAll | public void putAll(Map m)(Code) | | Every object put here will become a PassivationObj.
|
size | public synchronized int size()(Code) | | |
|
|