Interface ServerCache


public interface ServerCache
Represents part of the "L2" server side cache.

This is used to cache beans or query results (bean collections).

There are 2 ServerCache's for each bean type. One is used as the 'bean cache' which holds beans of a given type. The other is the 'query cache' holding query results for a given type.

  • Method Summary

    Modifier and Type Method Description
    void clear()
    Clear all entries from the cache.
    Object get​(Object id)
    Return the value given the key.
    default Map<Object,​Object> getAll​(Set<Object> keys)  
    int getHitRatio()
    Return the hit ratio the cache is currently getting.
    ServerCacheStatistics getStatistics​(boolean reset)
    Return statistics for the cache.
    void put​(Object id, Object value)
    Put the value in the cache with a given id.
    default void putAll​(Map<Object,​Object> keyValues)
    Put all the values in the cache.
    void remove​(Object id)
    Remove a entry from the cache given its id.
    default void removeAll​(Set<Object> keys)
    Remove the entries from the cache given the id values.
    int size()
    Return the number of entries in the cache.
    default void visit​(MetricVisitor visitor)
    Visit the metrics for the cache.
  • Method Details

    • getAll

      default Map<Object,​Object> getAll​(Set<Object> keys)
    • get

      Object get​(Object id)
      Return the value given the key.
    • putAll

      default void putAll​(Map<Object,​Object> keyValues)
      Put all the values in the cache.
    • put

      void put​(Object id, Object value)
      Put the value in the cache with a given id.
    • removeAll

      default void removeAll​(Set<Object> keys)
      Remove the entries from the cache given the id values.
    • remove

      void remove​(Object id)
      Remove a entry from the cache given its id.
    • clear

      void clear()
      Clear all entries from the cache.
    • size

      int size()
      Return the number of entries in the cache.
    • getHitRatio

      Return the hit ratio the cache is currently getting.
    • getStatistics

      Return statistics for the cache.
      Parameters:
      reset - if true the statistics are reset.
    • visit

      default void visit​(MetricVisitor visitor)
      Visit the metrics for the cache.