|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISyncHash
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)
Deprecated. use put(String,Object,Date) insatead. |
java.lang.Object |
put(java.lang.String key,
java.lang.Object v,
java.util.Date date)
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 |
---|
java.lang.String getName()
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
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.
java.lang.Object put(java.lang.String key, java.lang.Object v, java.util.Date date)
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
- valuedate
- Date object specifying the expiration time
for this object in the hash. The object added
will expire at the time specified by the date.
Null is not allowed.
java.lang.Object get(java.lang.String key)
key
- void clear()
java.lang.Object remove(java.lang.String key)
key
-
int size()
java.util.Set keySet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |