|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class presents functionality like a hashtable but with cluster sync and LRU behaviors. Note that the use of this object has performance implications. Size should be consider by cost-to-reload data vs memory usage per VM; cluster sync should be used only when a backing store is likely to change and invalidate stored results in a given VM.
Operational considerations (from Netscape) suggest that data read vs write from a synchronized hash should be in a 80/20 ratio if the synchronization is across multiple machines. Non synchronized hashs do not have this suggested restriction. In theory the cost is also low if multiple VM's are on a single machine.
Method Summary | |
void |
clear()
Empty a hash - causes cluster sync as needed |
java.lang.Object |
get(java.lang.String key)
Get an object from hash - performs required data validation/VM synchronization checks as needed. |
java.lang.String |
getName()
Get name |
java.util.Set |
keySet()
Return a set of all of the keys in the current hash. |
java.lang.Object |
put(java.lang.String key,
java.lang.Object v)
Add something to the hash; will generate appropriate cluster sync methods and LRU behavior. |
java.lang.Object |
put(java.lang.String key,
java.lang.Object v,
java.util.Calendar cal)
Add something to the hash; will generate appropriate cluster sync methods and LRU behavior. |
java.lang.Object |
remove(java.lang.String key)
Remove an item |
int |
size()
Return the size of the current hash |
Method Detail |
public java.lang.String getName()
public java.lang.Object put(java.lang.String key, java.lang.Object v) throws java.lang.NullPointerException
key
- Use meaningful, reproducable key names
for proper behavior. Limit length; don't
use multi-K length keys. 64chars or less is a
good guide; 16 chars is optimal for performance
but may not be unique.v
- value
java.lang.NullPointerException
public java.lang.Object put(java.lang.String key, java.lang.Object v, java.util.Calendar cal)
key
- Use meaningful, reproducable key names
for proper behavior. Limit length; don't
use multi-K length keys. 64chars or less is a
good guide; 16 chars is optimal for performance
but may not be unique.v
- valuecal
- Calendar object specifying the expiration time
for this object in the hash. The object added
will expire at the time specified by the calendar.
Null is not allowed.
public java.lang.Object get(java.lang.String key)
key
- public void clear()
public java.lang.Object remove(java.lang.String key)
key
-
public int size()
public java.util.Set keySet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |