Class SimpleCacheResolver

java.lang.Object
org.springframework.geode.cache.SimpleCacheResolver

public abstract class SimpleCacheResolver extends Object
The SimpleCacheResolver abstract class contains utility functions for resolving Apache Geode GemFireCache instances, such as a ClientCache or a peer Cache.
Since:
1.3.0
See Also:
  • Cache
  • CacheFactory
  • GemFireCache
  • RegionService
  • ClientCache
  • ClientCacheFactory
  • Constructor Details

    • SimpleCacheResolver

      public SimpleCacheResolver()
  • Method Details

    • getInstance

      public static SimpleCacheResolver getInstance()
      Lazily constructs and gets an instance to the SimpleCacheResolver, as needed.
      Returns:
      an instance of the SimpleCacheResolver.
      See Also:
      • newSimpleCacheResolver()
    • resolve

      public <T extends org.apache.geode.cache.GemFireCache> Optional<T> resolve()
      The resolution algorithm first tries to resolve an Optional ClientCache instance then a peer Cache instance if a ClientCache is not present. If neither a ClientCache or peer Cache is available, then Optional.empty() is returned. No Exception is thrown.
      Type Parameters:
      T - subclass of GemFireCache.
      Returns:
      a ClientCache or then a peer Cache instance if present.
      See Also:
    • resolveClientCache

      public Optional<org.apache.geode.cache.client.ClientCache> resolveClientCache()
      Attempts to resolve an Optional ClientCache instance.
      Returns:
      an Optional ClientCache instance.
      See Also:
    • resolvePeerCache

      public Optional<org.apache.geode.cache.Cache> resolvePeerCache()
      Attempts to resolve an Optional Cache instance.
      Returns:
      an Optional Cache instance.
      See Also:
    • require

      public <T extends org.apache.geode.cache.GemFireCache> T require()
      Requires an instance of either a ClientCache or a peer Cache.
      Type Parameters:
      T - subclass of GemFireCache to resolve.
      Returns:
      an instance of either a ClientCache or a peer Cache.
      Throws:
      IllegalStateException - if a cache instance cannot be resolved.
      See Also: