You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/reference/docbook/cache.xml
+18-17Lines changed: 18 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ public Book findBook(ISBN isbn) {...}]]></programlisting>
113
113
obvious when the target method has multiple arguments out of which only some are suitable for caching (while the rest are used only by the method logic). For example:</para>
public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed]]></programlisting>
116
+
public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed)]]></programlisting>
117
117
118
118
<para>At first glance, while the two <literal>boolean</literal> arguments influence the way the book is found, they are no use for the cache. Further more what if only one of the two
119
119
is important while the other is not?</para>
@@ -128,7 +128,7 @@ public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed]]></
@@ -530,8 +529,8 @@ public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed)]]><
530
529
<title>Configuring the cache storage</title>
531
530
532
531
<para>Out of the box, the cache abstraction provides integration with two storages - one on top of the JDK <interfacename>ConcurrentMap</interfacename> and one
533
-
for <linkxl:href="ehcache.org">ehcache</link> library. To use them, one needs to simply declare an appropriate <interfacename>CacheManager</interfacename> - an entity that controls and manages
534
-
<interfacename>Cache</interfacename>s and can be used to retrieve these for storage.</para>
532
+
for <linkxl:href="http://ehcache.org/">EhCache</link> library. To use them, one needs to simply declare an appropriate <interfacename>CacheManager</interfacename> - an entity that controls and
533
+
manages <interfacename>Cache</interfacename>s and can be used to retrieve these for storage.</para>
<para>The snippet above uses the <classname>SimpleCacheManager</classname> to create a <interfacename>CacheManager</interfacename> for the two, nested <interfacename>Concurrent</interfacename>
553
-
<interfacename>Cache</interfacename> implementations named <emphasis>default</emphasis> and <emphasis>books</emphasis>.
551
+
<para>The snippet above uses the <classname>SimpleCacheManager</classname> to create a <interfacename>CacheManager</interfacename> for the two nested <classname>ConcurrentMapCache</classname>
552
+
instances named <emphasis>default</emphasis> and <emphasis>books</emphasis>.
554
553
Note that the names are configured directly for each cache.</para>
555
554
556
555
<para>As the cache is created by the application, it is bound to its lifecycle, making it suitable for basic use cases, tests or simple applications. The cache scales well and is very fast
@@ -588,10 +587,12 @@ public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed)]]><
588
587
one can wire in a simple, dummy cache that performs no caching - that is, forces the cached methods to be executed every time:</para>
0 commit comments