INT-1552 doc polishing

This commit is contained in:
Mark Fisher
2010-11-22 10:46:20 -05:00
parent 5351dd3b47
commit 229345838e

View File

@@ -5,9 +5,11 @@
<para>
A Channel Adapter is a Message Endpoint that enables connecting a single sender or receiver to a Message Channel.
Spring Integration provides a number of adapters out of the box to support various transports, such as JMS, File,
HTTP, Web Services, and Mail. Those will be discussed in upcoming chapters of this reference guide. However, this
HTTP, Web Services, Mail, and more. Those will be discussed in upcoming chapters of this reference guide. However, this
chapter focuses on the simple but flexible Method-invoking Channel Adapter support. There are both inbound and
outbound adapters, and each may be configured with XML elements provided in the core namespace.
outbound adapters, and each may be configured with XML elements provided in the core namespace. These provide an
easy way to extend Spring Integration as long as you have a method that can be invoked as either a source or
destination.
</para>
<section id="channel-adapter-namespace-inbound">
@@ -18,8 +20,7 @@
When the adapter's subscription is activated, a poller will attempt to receive messages from the source. The
poller will be scheduled with the <interfacename>TaskScheduler</interfacename> according to the provided
configuration. To configure the polling interval or cron expression for an individual channel-adapter,
provide a 'poller' element with either an 'interval-trigger' (in milliseconds) or 'cron-trigger'
sub-element.
provide a 'poller' element with one of the scheduling attributes, such as 'fixed-rate' or 'cron'.
<programlisting language="xml"><![CDATA[<inbound-channel-adapter ref="source1" method="method1" channel="channel1">
<poller fixed-rate="5000"/>
</inbound-channel-adapter>
@@ -41,21 +42,27 @@
<para>
An "outbound-channel-adapter" element can also connect a <interfacename>MessageChannel</interfacename> to any POJO consumer
method that should be invoked with the payload of Messages sent to that channel.
<programlisting language="xml"><![CDATA[<outbound-channel-adapter channel="channel1" ref="target1" method="method1"/>]]></programlisting>
<programlisting language="xml"><![CDATA[<outbound-channel-adapter channel="channel1" ref="target" method="handle"/>
<beans:bean id="target" class="org.Foo"/>]]>
</programlisting>
If the channel being adapted is a <interfacename>PollableChannel</interfacename>, provide a poller sub-element:
<programlisting language="xml"><![CDATA[<outbound-channel-adapter channel="channel2" ref="target2" method="method2">
<programlisting language="xml"><![CDATA[<outbound-channel-adapter channel="channel2" ref="target" method="handle">
]]><emphasis><![CDATA[<poller fixed-rate="3000"/>
]]></emphasis><![CDATA[
</outbound-channel-adapter>
<beans:bean id="target1" class="org.bar.Foo"/>
<beans:bean id="target" class="org.Foo"/>
]]></programlisting>
</para>
<para>
Using a "ref" attribute is generally recommended if the POJO consumer implementation can be reused
in other <code>&lt;outbound-channel-adapter&gt;</code> definitions. However if the consumer implementation
should be scoped to a single definition of the <code>&lt;outbound-channel-adapter&gt;</code>, you can define it as inner bean:
<programlisting language="xml"><![CDATA[<outbound-channel-adapter channel="channel2" method="method2">
<beans:bean class="org.bar.Foo"/>
is only referenced by a single definition of the <code>&lt;outbound-channel-adapter&gt;</code>, you
can define it as inner bean:
<programlisting language="xml"><![CDATA[<outbound-channel-adapter channel="channel" method="handle">
<beans:bean class="org.Foo"/>
]]><![CDATA[
</outbound-channel-adapter>
]]></programlisting>
@@ -63,7 +70,8 @@
<note>
<para>
Using both the "ref" attribute and an inner handler definition in the same <code>&lt;outbound-channel-adapter&gt;</code>
configuration is not allowed, as it creates an ambiguous condition and will result in an Exception being thrown.
configuration is not allowed as it creates an ambiguous condition. Such a configuration will result in an Exception
being thrown.
</para>
</note>
<para>