类 NullCache

java.lang.Object
net.oschina.j2cache.NullCache
所有已实现的接口:
Cache, Level1Cache, Level2Cache

public class NullCache extends Object implements Level1Cache, Level2Cache
空的缓存Provider
作者:
Winter Lau(javayou@gmail.com)
  • 构造器详细资料

    • NullCache

      public NullCache()
  • 方法详细资料

    • ttl

      public long ttl()
      从接口复制的说明: Level1Cache
      返回该缓存区域的 TTL 设置(单位:秒)
      指定者:
      ttl 在接口中 Level1Cache
      返回:
      true if cache support ttl setting
    • size

      public long size()
      从接口复制的说明: Level1Cache
      返回该缓存区域中,内存存储对象的最大数量
      指定者:
      size 在接口中 Level1Cache
      返回:
      cache size in memory
    • get

      public Object get(String key)
      从接口复制的说明: Cache
      Get an item from the cache, nontransactionally
      指定者:
      get 在接口中 Cache
      指定者:
      get 在接口中 Level2Cache
      参数:
      key - cache key
      返回:
      the cached object or null
    • put

      public void put(String key, Object value)
      从接口复制的说明: Cache
      Add an item to the cache, nontransactionally, with failfast semantics
      指定者:
      put 在接口中 Cache
      指定者:
      put 在接口中 Level2Cache
      参数:
      key - cache key
      value - cache value
    • put

      public void put(String key, Object value, long timeToLiveInSeconds)
      从接口复制的说明: Level2Cache
      设置缓存数据的有效期
      指定者:
      put 在接口中 Level2Cache
      参数:
      key - cache key
      value - cache value
      timeToLiveInSeconds - cache ttl
    • keys

      public Collection<String> keys()
      从接口复制的说明: Cache
      Return all keys
      指定者:
      keys 在接口中 Cache
      指定者:
      keys 在接口中 Level2Cache
      返回:
      返回键的集合
    • get

      public Map get(Collection<String> keys)
      从接口复制的说明: Cache
      批量获取缓存对象
      指定者:
      get 在接口中 Cache
      指定者:
      get 在接口中 Level2Cache
      参数:
      keys - cache keys
      返回:
      return key-value objects
    • exists

      public boolean exists(String key)
      从接口复制的说明: Cache
      判断缓存是否存在
      指定者:
      exists 在接口中 Cache
      指定者:
      exists 在接口中 Level2Cache
      参数:
      key - cache key
      返回:
      true if key exists
    • put

      public void put(Map<String,Object> elements)
      从接口复制的说明: Cache
      批量插入数据
      指定者:
      put 在接口中 Cache
      指定者:
      put 在接口中 Level2Cache
      参数:
      elements - objects to be put in cache
    • getBytes

      public byte[] getBytes(String key)
      从接口复制的说明: Level2Cache
      读取缓存数据字节数组
      指定者:
      getBytes 在接口中 Level2Cache
      参数:
      key - cache key
      返回:
      cache data
    • getBytes

      public List<byte[]> getBytes(Collection<String> key)
      从接口复制的说明: Level2Cache
      同时读取多个 Key
      指定者:
      getBytes 在接口中 Level2Cache
      参数:
      key - multiple cache key
      返回:
      cache values
    • setBytes

      public void setBytes(String key, byte[] bytes)
      从接口复制的说明: Level2Cache
      设置缓存数据字节数组
      指定者:
      setBytes 在接口中 Level2Cache
      参数:
      key - cache key
      bytes - cache data
    • setBytes

      public void setBytes(Map<String,byte[]> bytes)
      从接口复制的说明: Level2Cache
      同时设置多个数据
      指定者:
      setBytes 在接口中 Level2Cache
      参数:
      bytes - cache data
    • evict

      public void evict(String... keys)
      从接口复制的说明: Cache
      Remove items from the cache
      指定者:
      evict 在接口中 Cache
      指定者:
      evict 在接口中 Level2Cache
      参数:
      keys - Cache key
    • clear

      public void clear()
      从接口复制的说明: Cache
      Clear the cache
      指定者:
      clear 在接口中 Cache
      指定者:
      clear 在接口中 Level2Cache