Fix incorrect doc on injection of opsForXXX

This commit is contained in:
Jennifer Hickey
2013-07-25 09:44:11 -07:00
parent dd8bc2eaaa
commit 800b8700f0
3 changed files with 6 additions and 5 deletions

View File

@@ -29,7 +29,7 @@
requires raw-data (array of bytes), the <classname>RedisTemplate</classname> allow arbitrary objects to be passed requires raw-data (array of bytes), the <classname>RedisTemplate</classname> allow arbitrary objects to be passed
in as messages:</para> in as messages:</para>
<programlisting lang="java"><![CDATA[// send message through connection <programlisting language="java">// send message through connection
RedisConnection con = ... RedisConnection con = ...
byte[] msg = ... byte[] msg = ...
byte[] channel = ... byte[] channel = ...
@@ -38,7 +38,8 @@ con.publish(msg, channel);
// send message through RedisTemplate // send message through RedisTemplate
RedisTemplate template = ... RedisTemplate template = ...
template.convertAndSend("hello!", "world");]]></programlisting> template.convertAndSend("hello!", "world");
</programlisting>
</section> </section>
<section id="redis:pubsub:subscribe"> <section id="redis:pubsub:subscribe">

View File

@@ -10,7 +10,7 @@
as when using Redis transactions. For example: as when using Redis transactions. For example:
</para> </para>
<programlisting lang="java"><![CDATA[ //execute a transaction <programlisting language="java"><![CDATA[ //execute a transaction
redisTemplate.execute(new SessionCallback<Object>() { redisTemplate.execute(new SessionCallback<Object>() {
public Object execute(RedisOperations operations) throws DataAccessException { public Object execute(RedisOperations operations) throws DataAccessException {
operations.multi(); operations.multi();

View File

@@ -329,11 +329,11 @@
<programlisting language="java"><![CDATA[public class Example { <programlisting language="java"><![CDATA[public class Example {
// inject the actual template // inject the actual template
@Resource(name="redisTemplate") @Autowired
private RedisTemplate<String, String> template; private RedisTemplate<String, String> template;
// inject the template as ListOperations // inject the template as ListOperations
@Autowired @Resource(name="redisTemplate")
private ListOperations<String, String> listOps; private ListOperations<String, String> listOps;
public void addLink(String userId, URL url) { public void addLink(String userId, URL url) {