public class DistributedStateCacheImpl extends Object implements com.sun.enterprise.ee.cms.core.DistributedStateCache
When an entry is added or removed, this implementation uses underlying GroupCommunicationProvider(GCP) to sends a message to the all members of the group. The recipients in turn call corresponding method for adding or removing the entry to/from their copy of the this DistributedStateCache implementation.
When new member joins the group, the join notification is received on every member. When this happens, and if this member is a leader of the group, then it uses the GCP's messaging api to sends a message to the new member to pass on the current state of this DSC. The remote member updates its DSC with this current state while returning its own state to this member through another message. This member updates its own DSC with this new entry resulting in all members getting this updated state. This brings the group-wide DSC into a synchronized state.
This initial sync-up is a heavy weight operation particularly during startup of the whole group concurrently as new members are joining the group rapidly. To prevent data loss during such times, each sync activity will require a blocking call to ensure that rapid group view changes during group startup will not result in data loss.
| Modifier and Type | Method and Description |
|---|---|
void |
addToCache(String componentName,
String memberTokenId,
Serializable key,
byte[] state) |
void |
addToCache(String componentName,
String memberTokenId,
Serializable key,
Serializable state) |
void |
addToLocalCache(com.sun.enterprise.ee.cms.core.GMSCacheable cKey,
Object state) |
void |
addToLocalCache(String componentName,
String memberTokenId,
Serializable key,
byte[] state) |
void |
addToLocalCache(String componentName,
String memberTokenId,
Serializable key,
Serializable state) |
boolean |
contains(Object key) |
boolean |
contains(String componentName,
Object key) |
Map<com.sun.enterprise.ee.cms.core.GMSCacheable,Object> |
getAllCache() |
Map<com.sun.enterprise.ee.cms.core.GMSCacheable,Object> |
getFromCache(Object key) |
Object |
getFromCache(String componentName,
String memberTokenId,
Serializable key) |
Map<Serializable,Serializable> |
getFromCacheForPattern(String componentName,
String memberToken) |
boolean |
isFirstSyncDone() |
void |
removeAll()
Empties the DistributedStateCache.
|
void |
removeAllForMember(String memberToken) |
void |
removeFromCache(String componentName,
String memberTokenId,
Serializable key) |
String |
toString() |
public void addToCache(String componentName, String memberTokenId, Serializable key, Serializable state) throws com.sun.enterprise.ee.cms.core.GMSException
addToCache in interface com.sun.enterprise.ee.cms.core.DistributedStateCachecom.sun.enterprise.ee.cms.core.GMSExceptionpublic void addToCache(String componentName, String memberTokenId, Serializable key, byte[] state) throws com.sun.enterprise.ee.cms.core.GMSException
com.sun.enterprise.ee.cms.core.GMSExceptionpublic void addToLocalCache(String componentName, String memberTokenId, Serializable key, Serializable state)
addToLocalCache in interface com.sun.enterprise.ee.cms.core.DistributedStateCachepublic void addToLocalCache(String componentName, String memberTokenId, Serializable key, byte[] state)
public void addToLocalCache(com.sun.enterprise.ee.cms.core.GMSCacheable cKey,
Object state)
public void removeFromCache(String componentName, String memberTokenId, Serializable key) throws com.sun.enterprise.ee.cms.core.GMSException
removeFromCache in interface com.sun.enterprise.ee.cms.core.DistributedStateCachecom.sun.enterprise.ee.cms.core.GMSExceptionpublic Object getFromCache(String componentName, String memberTokenId, Serializable key) throws com.sun.enterprise.ee.cms.core.GMSException
getFromCache in interface com.sun.enterprise.ee.cms.core.DistributedStateCachecom.sun.enterprise.ee.cms.core.GMSExceptionpublic Map<com.sun.enterprise.ee.cms.core.GMSCacheable,Object> getAllCache()
getAllCache in interface com.sun.enterprise.ee.cms.core.DistributedStateCachepublic Map<Serializable,Serializable> getFromCacheForPattern(String componentName, String memberToken)
getFromCacheForPattern in interface com.sun.enterprise.ee.cms.core.DistributedStateCachepublic Map<com.sun.enterprise.ee.cms.core.GMSCacheable,Object> getFromCache(Object key)
getFromCache in interface com.sun.enterprise.ee.cms.core.DistributedStateCachepublic boolean contains(Object key)
contains in interface com.sun.enterprise.ee.cms.core.DistributedStateCachepublic boolean contains(String componentName, Object key)
contains in interface com.sun.enterprise.ee.cms.core.DistributedStateCachepublic boolean isFirstSyncDone()
isFirstSyncDone in interface com.sun.enterprise.ee.cms.core.DistributedStateCachepublic void removeAll()
removeAll in interface com.sun.enterprise.ee.cms.core.DistributedStateCachepublic void removeAllForMember(String memberToken)
removeAllForMember in interface com.sun.enterprise.ee.cms.core.DistributedStateCacheCopyright © 2017–2019 Eclipse Foundation. All rights reserved.