com.gilt.gfc.cache

AsyncToSyncCacheAdapter

trait AsyncToSyncCacheAdapter[K, V] extends SyncCache[K, V] with SyncCacheEventNotifierImpl[K, V] with AsyncCacheEventHandler[K, V] with DerivedCacheBaseImpl

Adapts an AsyncCache to the SyncCache interface. Updates to the async parent cache become visible as the values become available and cache lookups to the sync cache trigger async on-cache-miss. But due to the sync nature of the adapter, these cache misses only become visible when the async call has returned, i.e. some time later. The behaviour will be that a cache miss will return None initially and Some some time later.

Since

19/Apr/2016 17:55

Linear Supertypes
DerivedCacheBaseImpl, Loggable, AsyncCacheEventHandler[K, V], SyncCacheEventNotifierImpl[K, V], SyncCache[K, V], SyncCacheEventNotifier[K, V], CacheBase, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncToSyncCacheAdapter
  2. DerivedCacheBaseImpl
  3. Loggable
  4. AsyncCacheEventHandler
  5. SyncCacheEventNotifierImpl
  6. SyncCache
  7. SyncCacheEventNotifier
  8. CacheBase
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def parent: AsyncCache[K, V]

    The parent this cache is derived from.

    The parent this cache is derived from.

    Definition Classes
    AsyncToSyncCacheAdapter → DerivedCacheBaseImpl

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def asMap: Map[K, V]

    Definition Classes
    AsyncToSyncCacheAdapterSyncCache
  8. def checkStarted(): Unit

    Attributes
    protected
    Definition Classes
    AsyncToSyncCacheAdapter → CacheBase
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def debug(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  11. def debug(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def error(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  15. def error(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  16. def error(ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  17. def fatal(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  18. def fatal(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  19. def fatal(ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  20. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def get(key: K): Option[V]

    Try to load a value from the cache with the given key.

    Try to load a value from the cache with the given key.

    This will try to fetch the value from the in-memory cache with no remote call on cache-misses.

    key

    unique key of the needed value.

    returns

    an optional value if found, None otherwise.

    Definition Classes
    AsyncToSyncCacheAdapterSyncCache
  22. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  23. final def getOpt(key: K): Optional[V]

    Definition Classes
    SyncCache
  24. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  25. def info(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  26. def info(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  27. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  28. def isStarted: Boolean

    Test if the cache has been started.

    Test if the cache has been started.

    Definition Classes
    DerivedCacheBaseImpl → CacheBase
  29. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  32. def notifyCacheReloadFor(cache: Iterable[(K, V)]): Unit

    Notifies all registered SyncCacheEventHandler's that cache was reloaded.

    Notifies all registered SyncCacheEventHandler's that cache was reloaded.

    cache

    - cache that was reloaded

    Definition Classes
    SyncCacheEventNotifierImpl
  33. def onCacheMissLoad(key: K, value: V): Unit

    Defines callback for cache miss.

    Defines callback for cache miss.

    key

    - key for which we have a cache miss

    value

    - value for which we have a cache miss

    Definition Classes
    AsyncToSyncCacheAdapterAsyncCacheEventHandler
  34. def onCacheReload(fromCache: Iterable[(K, V)]): Unit

    Defines callback for cache reload.

    Defines callback for cache reload.

    fromCache

    - the cache that was reloaded

    Definition Classes
    AsyncToSyncCacheAdapterAsyncCacheEventHandler
  35. def register(): AsyncToSyncCacheAdapter.this.type

    Loads the content of this cache from its parent, if the parent is started.

    Loads the content of this cache from its parent, if the parent is started. Register itself for parent cache change notifications.

    This method should be called only once, when the cache is ready to receive notifications. Subsequent calls to this method are of no effect.

    returns

    this cache ready to receive notifications from its parent

  36. def registerHandler(handler: SyncCacheEventHandler[K, V]): Unit

    Register a SyncCacheEventHandler to be notified for cache events.

    Register a SyncCacheEventHandler to be notified for cache events.

    handler

    - the handler to be notified for cache events

    Definition Classes
    SyncCacheEventNotifierImplSyncCacheEventNotifier
  37. def shutdown(): Unit

    Stop the cache from loading.

    Stop the cache from loading.

    Definition Classes
    DerivedCacheBaseImpl → CacheBase
  38. def start(): AsyncToSyncCacheAdapter.this.type

    Starts the loading of the cache.

    Starts the loading of the cache.

    Definition Classes
    DerivedCacheBaseImpl → CacheBase
  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  40. def toString(): String

    Definition Classes
    AnyRef → Any
  41. def trace(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  42. def trace(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  43. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. def warn(message: ⇒ String, ex: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Loggable
  47. def warn(message: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Loggable

Inherited from DerivedCacheBaseImpl

Inherited from Loggable

Inherited from AsyncCacheEventHandler[K, V]

Inherited from SyncCacheEventNotifierImpl[K, V]

Inherited from SyncCache[K, V]

Inherited from SyncCacheEventNotifier[K, V]

Inherited from CacheBase

Inherited from AnyRef

Inherited from Any

Ungrouped