+ update cache docs whitespace for better rendering
This commit is contained in:
parent
933e22320d
commit
e493887f45
|
@ -430,23 +430,23 @@ public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed)]]><
|
||||||
can be translated into:</para>
|
can be translated into:</para>
|
||||||
|
|
||||||
<programlisting language="xml"><![CDATA[<!-- the service we want to make cacheable -->
|
<programlisting language="xml"><![CDATA[<!-- the service we want to make cacheable -->
|
||||||
<bean id="bookService" class="x.y.service.DefaultBookService"/>
|
<bean id="bookService" class="x.y.service.DefaultBookService"/>
|
||||||
|
|
||||||
<!-- cache definitions -->
|
<!-- cache definitions -->
|
||||||
<cache:advice id="cacheAdvice" cache-manager="cacheManager">
|
<cache:advice id="cacheAdvice" cache-manager="cacheManager">
|
||||||
<cache:definitions cache="books">
|
<cache:definitions cache="books">
|
||||||
<cache:cacheable method="findBook" key="#isbn"/>
|
<cache:cacheable method="findBook" key="#isbn"/>
|
||||||
<cache:cache-evict method="loadBooks" all-entries="true"/>
|
<cache:cache-evict method="loadBooks" all-entries="true"/>
|
||||||
</cache:definitions>
|
</cache:definitions>
|
||||||
</cache:advice>
|
</cache:advice>
|
||||||
|
|
||||||
<!-- apply the cacheable behaviour to all BookService interfaces -->
|
<!-- apply the cacheable behaviour to all BookService interfaces -->
|
||||||
<aop:config>
|
<aop:config>
|
||||||
<aop:advisor advice-ref="cacheAdvice" pointcut="execution(* x.y.BookService.*(..))"/>
|
<aop:advisor advice-ref="cacheAdvice" pointcut="execution(* x.y.BookService.*(..))"/>
|
||||||
</aop:config>
|
</aop:config>
|
||||||
...
|
...
|
||||||
// cache manager definition omitted
|
// cache manager definition omitted
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<para>In the configuration above, the <literal>bookService</literal> is made cacheable. The caching semantics to apply are encapsulated in the <literal>cache:advice</literal> definition which
|
<para>In the configuration above, the <literal>bookService</literal> is made cacheable. The caching semantics to apply are encapsulated in the <literal>cache:advice</literal> definition which
|
||||||
|
@ -518,11 +518,11 @@ public Book findBook(ISBN isbn, boolean checkWarehouse, boolean includeUsed)]]><
|
||||||
one can wire in a simple, dummy cache that performs no caching - that is, forces the cached methods to be executed every time:</para>
|
one can wire in a simple, dummy cache that performs no caching - that is, forces the cached methods to be executed every time:</para>
|
||||||
|
|
||||||
<programlisting language="xml"><![CDATA[<bean id="cacheManager" class="org.springframework.cache.support.CompositeCacheManager">
|
<programlisting language="xml"><![CDATA[<bean id="cacheManager" class="org.springframework.cache.support.CompositeCacheManager">
|
||||||
<property name="cacheManagers"><list>
|
<property name="cacheManagers"><list>
|
||||||
<ref bean="jdkCache"/>
|
<ref bean="jdkCache"/>
|
||||||
<ref bean="gemfireCache"/>
|
<ref bean="gemfireCache"/>
|
||||||
</list></property>
|
</list></property>
|
||||||
<property name="addNoOpCache" value="true"/>
|
<property name="addNoOpCache" value="true"/>
|
||||||
</bean>]]></programlisting>
|
</bean>]]></programlisting>
|
||||||
|
|
||||||
<para>The <literal>CompositeCacheManager</literal> above chains multiple <literal>CacheManager</literal>s and aditionally, through the <literal>addNoOpManager</literal> flag, adds a
|
<para>The <literal>CompositeCacheManager</literal> above chains multiple <literal>CacheManager</literal>s and aditionally, through the <literal>addNoOpManager</literal> flag, adds a
|
||||||
|
|
Loading…
Reference in New Issue