|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.util.ClusteredCache
public class ClusteredCache
Clustered implementation of the Cache interface using Tangosol's Coherence product. For handling RequestTimeoutExceptions with Coherence 3.3, the strategy is to log and throw the exceptions for puts and removes. Gets can fail gracefully since content will be pulled from the database.
Nested Class Summary | |
---|---|
static class |
ClusteredCache.CacheCollectionWrapper
|
static class |
ClusteredCache.CacheIterator
|
static class |
ClusteredCache.CacheSetWrapper
|
Nested classes/interfaces inherited from interface com.tangosol.util.QueryMap |
---|
com.tangosol.util.QueryMap.Entry |
Nested classes/interfaces inherited from interface com.tangosol.util.InvocableMap |
---|
com.tangosol.util.InvocableMap.Entry, com.tangosol.util.InvocableMap.EntryAggregator, com.tangosol.util.InvocableMap.EntryProcessor, com.tangosol.util.InvocableMap.ParallelAwareAggregator |
Field Summary | |
---|---|
protected com.tangosol.net.NamedCache |
map
The map is used for distributed operations such as get, put, etc. |
Constructor Summary | |
---|---|
protected |
ClusteredCache(java.lang.String name)
Create a new cache. |
protected |
ClusteredCache(java.lang.String name,
com.tangosol.net.NamedCache cache)
Create a new cache using the supplied named cache as the actual cache implementation |
Method Summary | |
---|---|
void |
addIndex(com.tangosol.util.ValueExtractor valueExtractor,
boolean sorted,
java.util.Comparator comparator)
|
void |
addMemberListener(com.tangosol.net.MemberListener listener)
|
java.lang.Object |
aggregate(java.util.Collection collection,
com.tangosol.util.InvocableMap.EntryAggregator entryAggregator)
|
java.lang.Object |
aggregate(com.tangosol.util.Filter filter,
com.tangosol.util.InvocableMap.EntryAggregator entryAggregator)
|
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
|
java.util.Set |
entrySet(com.tangosol.util.Filter filter)
|
java.util.Set |
entrySet(com.tangosol.util.Filter filter,
java.util.Comparator comparator)
|
java.lang.Object |
get(java.lang.Object key)
|
long |
getCacheHits()
Returns the number of cache hits. |
long |
getCacheMisses()
Returns the number of cache misses. |
int |
getCacheSize()
Returns the size of the cache contents in bytes. |
int |
getMaxCacheSize()
Returns the maximum size of the cache in bytes. |
long |
getMaxLifetime()
Returns the maximum number of milliseconds that any object can live in cache. |
java.lang.String |
getName()
Returns the name of the cache. |
java.lang.Object |
invoke(java.lang.Object object,
com.tangosol.util.InvocableMap.EntryProcessor entryProcessor)
|
java.util.Map |
invokeAll(java.util.Collection collection,
com.tangosol.util.InvocableMap.EntryProcessor entryProcessor)
|
java.util.Map |
invokeAll(com.tangosol.util.Filter filter,
com.tangosol.util.InvocableMap.EntryProcessor entryProcessor)
|
boolean |
isEmpty()
|
java.util.Set |
keySet()
|
java.util.Set |
keySet(com.tangosol.util.Filter filter)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object object)
|
void |
putAll(java.util.Map entries)
|
java.lang.Object |
remove(java.lang.Object key)
|
void |
removeIndex(com.tangosol.util.ValueExtractor valueExtractor)
|
void |
removeMemberListener(com.tangosol.net.MemberListener listener)
|
void |
setMaxCacheSize(int maxSize)
Sets the maximum size of the cache in bytes. |
void |
setMaxLifetime(long maxLifetime)
Sets the maximum number of milliseconds that any object can live in cache. |
void |
setName(java.lang.String name)
Sets the name of the cache |
int |
size()
|
java.util.Collection |
values()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
protected com.tangosol.net.NamedCache map
Constructor Detail |
---|
protected ClusteredCache(java.lang.String name)
name
- a name for the cache, which should be unique per vm.protected ClusteredCache(java.lang.String name, com.tangosol.net.NamedCache cache)
name
- a name for the cache, which should be unique per vm.cache
- the cache implementationMethod Detail |
---|
public void addMemberListener(com.tangosol.net.MemberListener listener)
public void removeMemberListener(com.tangosol.net.MemberListener listener)
public java.lang.String getName()
Cache
getName
in interface Cache
public void setName(java.lang.String name)
Cache
setName
in interface Cache
name
- the name of the cachepublic java.lang.Object put(java.lang.Object key, java.lang.Object object)
put
in interface java.util.Map
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
public void clear()
clear
in interface java.util.Map
public int size()
size
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public java.util.Set keySet()
keySet
in interface java.util.Map
public void putAll(java.util.Map entries)
putAll
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map
public long getCacheHits()
Cache
Keeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
getCacheHits
in interface Cache
public long getCacheMisses()
Cache
Keeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
getCacheMisses
in interface Cache
public int getCacheSize()
Cache
getCacheSize
in interface Cache
public int getMaxCacheSize()
Cache
getMaxCacheSize
in interface Cache
public void setMaxCacheSize(int maxSize)
Cache
setMaxCacheSize
in interface Cache
maxSize
- the maximum size of the cache in bytes.public long getMaxLifetime()
Cache
getMaxLifetime
in interface Cache
public void setMaxLifetime(long maxLifetime)
Cache
setMaxLifetime
in interface Cache
maxLifetime
- the maximum number of milliseconds before objects are expired.public java.lang.Object invoke(java.lang.Object object, com.tangosol.util.InvocableMap.EntryProcessor entryProcessor)
invoke
in interface com.tangosol.util.InvocableMap
public java.util.Map invokeAll(java.util.Collection collection, com.tangosol.util.InvocableMap.EntryProcessor entryProcessor)
invokeAll
in interface com.tangosol.util.InvocableMap
public java.util.Map invokeAll(com.tangosol.util.Filter filter, com.tangosol.util.InvocableMap.EntryProcessor entryProcessor)
invokeAll
in interface com.tangosol.util.InvocableMap
public java.lang.Object aggregate(java.util.Collection collection, com.tangosol.util.InvocableMap.EntryAggregator entryAggregator)
aggregate
in interface com.tangosol.util.InvocableMap
public java.lang.Object aggregate(com.tangosol.util.Filter filter, com.tangosol.util.InvocableMap.EntryAggregator entryAggregator)
aggregate
in interface com.tangosol.util.InvocableMap
public java.util.Set keySet(com.tangosol.util.Filter filter)
keySet
in interface com.tangosol.util.QueryMap
public java.util.Set entrySet(com.tangosol.util.Filter filter)
entrySet
in interface com.tangosol.util.QueryMap
public java.util.Set entrySet(com.tangosol.util.Filter filter, java.util.Comparator comparator)
entrySet
in interface com.tangosol.util.QueryMap
public void addIndex(com.tangosol.util.ValueExtractor valueExtractor, boolean sorted, java.util.Comparator comparator)
addIndex
in interface com.tangosol.util.QueryMap
public void removeIndex(com.tangosol.util.ValueExtractor valueExtractor)
removeIndex
in interface com.tangosol.util.QueryMap
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |