/** * Creates a Level 2 cache that internally maintains a separate satellite cache * for each thread that accesses it. On a cache miss, the parent cache will be * checked. On an insert, the value will propagate up to the parent cache. * Keys are compared by reference identity. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalIdentityCache(final Cache<K, V> parent) { return new ThreadLocalIdentityCache<>(VerifyArgument.notNull(parent, "parent")); } }
/** * Creates a Level 2 cache that internally maintains a separate satellite cache * for each thread that accesses it. On a cache miss, the parent cache will be * checked. On an insert, the value will propagate up to the parent cache. * Keys are compared by reference identity. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalIdentityCache(final Cache<K, V> parent) { return new ThreadLocalIdentityCache<>(VerifyArgument.notNull(parent, "parent")); } }
/** * Creates a Level 2 cache that internally maintains a separate satellite cache * for each thread that accesses it. On a cache miss, the parent cache will be * checked. On an insert, the value will propagate up to the parent cache. * Keys are compared by reference identity. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalIdentityCache(final Cache<K, V> parent) { return new ThreadLocalIdentityCache<>(VerifyArgument.notNull(parent, "parent")); } }