Class WidgetAsyncWarmUpCache<K,​V>

  • All Implemented Interfaces:
    AsyncWarmUpCache<K,​V>

    public class WidgetAsyncWarmUpCache<K,​V>
    extends java.lang.Object
    implements AsyncWarmUpCache<K,​V>
    A asynchronous warm up cache that is bound to particular widget instance.
    • Method Detail

      • getCallbackEvent

        protected org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> getCallbackEvent()
      • setCallbackEvent

        public void setCallbackEvent​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> callbackEvent)
      • warmUp

        public void warmUp​(java.util.Iterator<java.util.Collection<K>> keys,
                           java.util.function.Function<K,​V> values)
        Description copied from interface: AsyncWarmUpCache
        Triggers asynchronous cache warm up.
        Specified by:
        warmUp in interface AsyncWarmUpCache<K,​V>
        Parameters:
        keys - iterator over keys to be processed
        values - value provider
      • has

        public boolean has​(K key)
        Description copied from interface: AsyncWarmUpCache
        Checks whether a value for specified key is cached.
        Specified by:
        has in interface AsyncWarmUpCache<K,​V>
        Parameters:
        key - value key
        Returns:
        true if value is cached
      • get

        public V get​(K key)
        Description copied from interface: AsyncWarmUpCache
        Gets cached value for specified key.
        Specified by:
        get in interface AsyncWarmUpCache<K,​V>
        Parameters:
        key - value key
        Returns:
        value for key
      • get

        public V get​(K key,
                     java.util.function.Supplier<V> defaultValue)
        Description copied from interface: AsyncWarmUpCache
        Gets cached value for specified key. If cache has no value for specified key, default value provider is asked for it.
        Specified by:
        get in interface AsyncWarmUpCache<K,​V>
        Parameters:
        key - value key
        defaultValue - a supplier for a result in case value is not cached
        Returns:
        value for key
      • revoke

        public void revoke​(K key)
        Description copied from interface: AsyncWarmUpCache
        Removes a value cached for specified key.
        Specified by:
        revoke in interface AsyncWarmUpCache<K,​V>
        Parameters:
        key - value key
      • cancelRunningWarmingUp

        protected void cancelRunningWarmingUp()