DATAKV-25

+ add error handler setter on the container
+ improve docs
This commit is contained in:
Costin Leau
2011-01-25 13:33:24 +02:00
parent 60f7b65a73
commit fd9b74b41c
12 changed files with 252 additions and 34 deletions

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<appendix id="appendix-schema">
<title>Spring Data Key Value Schema(s)</title>
<para>Spring Data - Redis support</para>
<programlisting><xi:include href="../../../spring-data-redis/src/main/resources/org/springframework/data/keyvalue/redis/config/spring-redis-1.0.xsd" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:fallback>
<para><emphasis>FIXME: REDIS SCHEMA LOCATION/NAME CHANGED</emphasis></para>
</xi:fallback>
</xi:include>
</programlisting>
</appendix>

View File

@@ -0,0 +1,10 @@
<partintro>
<title>Document structure</title>
<para>
Various appendixes outside the reference documentation.
</para>
<para><xref linkend="appendix-schema"/> defines the schemas provided by Spring Data
Key Value.</para>
</partintro>

View File

@@ -50,6 +50,13 @@
<xi:include href="reference/riak.xml"/>
</part>
<part id="appendixes">
<title>Appendixes</title>
<xi:include href="appendix/introduction.xml"/>
<xi:include href="appendix/appendix-schema.xml"/>
</part>
<!--
<part id="resources">
<title>Other Documentation</title>

View File

@@ -40,7 +40,7 @@ con.publish(msg, channel);
// send message through RedisTemplate
RedisTemplate template = ...
template.publish("hello!", "world");]]></programlisting>
template.convertAndSend("hello!", "world");]]></programlisting>
</section>
<section id="redis:pubsub:subscribe">
@@ -147,6 +147,27 @@ template.publish("hello!", "world");]]></programlisting>
<emphasis>no</emphasis> Redis dependencies at all. It truly is a POJO that
we will make into an MDP via the following configuration.</para>
<programlisting language="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<lineannotation>xmlns:redis="http://www.springframework.org/schema/redis"</lineannotation>
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
<lineannotation>http://www.springframework.org/schema/redis http://www.springframework.org/schema/redis/spring-redis.xsd"</lineannotation>&gt;
&lt;!-- the default ConnectionFactory --&gt;
&lt;redis:listener-container&gt;
&lt;!-- the method attribute can be skipped as the default method name is "handleMessage" --&gt;
&lt;redis:listener ref="listener" method="handleMessage" channel="chatroom" /&gt;
&lt;/redis:listener-container&gt;
&lt;bean class="redisexample.DefaultMessageDelegate"/&gt;
...
&lt;beans&gt;
</programlisting>
<para>The example above uses the Redis namespace to declare the message listener container and automatically register the POJOs as listeners. The full blown, <emphasis>beans</emphasis> definition
is displayed below:</para>
<programlisting language="xml"><lineannotation>&lt;!-- this is the Message Driven POJO (MDP) --&gt;</lineannotation>
<emphasis role="bold">&lt;bean id="messageListener" class="org.springframework.data.keyvalue.redis.listener.adapter.MessageListenerAdapter"&gt;</emphasis>
&lt;constructor-arg&gt;

View File

@@ -259,7 +259,7 @@
private StringRedisTemplate redisTemplate;
public void addLink(String userId, URL url) {
redisTemplate.getListOps().leftPush(userId, url.toExternalForm());
redisTemplate.opsForList().leftPush(userId, url.toExternalForm());
}
}]]></programlisting>
<para>As with the other Spring templates, <classname>RedisTemplate</classname> and <classname>StringRedisTemplate</classname> allow the developer to talk directly to Redis through
@@ -276,6 +276,8 @@
});
}]]></programlisting>
</section>
<xi:include href="redis-messaging.xml"/>
<section id="redis:support">
<title>Support Classes</title>
@@ -318,8 +320,6 @@
development to production environments transparent and highly increases testability (the Redis implementation can just as well be replaced with an in-memory one).</para>
</section>
<xi:include href="redis-messaging.xml"/>
<section id="redis:future">
<title>Roadmap ahead</title>