public class RemoteCacheNoWaitFacade<K,V> extends AbstractRemoteCacheNoWaitFacade<K,V>
Typically, we only connect to one remote server per facade. We use a list of one RemoteCacheNoWait.
ICacheType.CacheType
Modifier and Type | Field and Description |
---|---|
protected boolean |
attemptRestorePrimary
Attempt to restore primary connection (switched off for testing)
|
noWaits
NAME_COMPONENT_DELIMITER
Constructor and Description |
---|
RemoteCacheNoWaitFacade(List<RemoteCacheNoWait<K,V>> noWaits,
IRemoteCacheAttributes rca,
ICacheEventLogger cacheEventLogger,
IElementSerializer elementSerializer,
RemoteCacheFactory cacheFactory)
Constructs with the given remote cache, and fires events to any listeners.
|
Modifier and Type | Method and Description |
---|---|
protected void |
connectAndRestore()
The thread tries to establish a connection with a failover
server, if any are defined.
|
protected void |
failover(RemoteCacheNoWait<K,V> rcnw)
Begin the failover process if this is a local cache.
|
dispose, get, getAuxiliaryCacheAttributes, getCacheName, getCacheType, getEventLoggingExtraInfo, getKeySet, getMatching, getMultiple, getPrimaryServer, getSize, getStatistics, getStats, getStatus, remove, removeAll, restorePrimaryServer, toString, update
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, processGetMultiple, setCacheEventLogger, setElementSerializer, setKeyMatcher
protected boolean attemptRestorePrimary
public RemoteCacheNoWaitFacade(List<RemoteCacheNoWait<K,V>> noWaits, IRemoteCacheAttributes rca, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer, RemoteCacheFactory cacheFactory)
noWaits
- rca
- cacheEventLogger
- elementSerializer
- cacheFactory
- protected void failover(RemoteCacheNoWait<K,V> rcnw)
failover
in class AbstractRemoteCacheNoWaitFacade<K,V>
rcnw
- The no wait in error.protected void connectAndRestore()
It works by switching out the RemoteCacheNoWait inside the Facade.
Client (i.e.) the CompositeCache has reference to a RemoteCacheNoWaitFacade. This facade is created by the RemoteCacheFactory. The factory maintains a set of managers, one for each remote server. Typically, there will only be one manager.
If you use multiple remote servers, you may want to set one or more as failovers. If a local cache cannot connect to the primary server, or looses its connection to the primary server, it will attempt to restore that Connection in the background. If failovers are defined, the Failover runner will try to connect to a failover until the primary is restored. If no failovers are defined, this will exit automatically.
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.