Class RemoteCacheNoWaitFacade<K,V>

All Implemented Interfaces:
AuxiliaryCache<K,V>, ICache<K,V>, ICacheType

Used to provide access to multiple services under nowait protection. Factory should construct NoWaitFacade to give to the composite cache out of caches it constructs from the varies manager to lateral services.

Typically, we only connect to one remote server per facade. We use a list of one RemoteCacheNoWait.

  • Field Details

    • attemptRestorePrimary

      protected boolean attemptRestorePrimary
      Attempt to restore primary connection (switched off for testing)
  • Constructor Details

  • Method Details

    • failover

      protected void failover(RemoteCacheNoWait<K,V> rcnw)
      Begin the failover process if this is a local cache. Clustered remote caches do not failover.

      Specified by:
      failover in class AbstractRemoteCacheNoWaitFacade<K,V>
      Parameters:
      rcnw - The no wait in error.
    • connectAndRestore

      protected void connectAndRestore()
      The thread tries to establish a connection with a failover server, if any are defined. Once a failover connection is made, it will attempt to replace the failover with the primary remote server.

      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.

      Since:
      3.1