INT-677, INT-682, INT-676 - Modified documentation around added support for inner-bean definition of message handlers within the namespace configuration.

This commit is contained in:
Oleg Zhurakousky
2009-06-26 01:17:39 +00:00
parent 20171072d6
commit 6a47c40dcb
5 changed files with 97 additions and 4 deletions

View File

@@ -40,6 +40,29 @@
<classname>String</classname>, then the endpoint will attempt to resolve the channel name to a channel instance.
If the channel cannot be resolved, then a <classname>ChannelResolutionException</classname> will be thrown.
</para>
<para>
The argument in the service method could be either a Message or an arbitrary type. If the later one, then it will be assumed that it is a Payload source,
which will be extracted from the message and injected into such service method. This is generally the recommended approach as it follows and promotes
a POJO model when working with Spring Integration.
Since v1.0.3 of Spring Integration, the service method does not require to have an argument at all, which means you can now implement event-style Service Activators,
where all you care about is an invocation of the service method not worrying about the contents of the message. Think of it as a NULL JMS message. An example use-case for such implementation
could be a simple counter/monitor of messages deposited on the input channel.
</para>
<para>
Using a "ref" attribute is generally recommended if custom Service Activator handler implementation can be reused in other <code>&lt;service-activator&gt;</code> definitions. However
if custom Service Activator handler implementation has to be scoped to a concrete definition of the <code>&lt;service-activator&gt;</code>, starting with v1.0.3, Spring Integration supports
inner bean definitions for custom Service Activator handlers within the <code>&lt;service-activator&gt;</code> element:
<programlisting language="xml"><![CDATA[<service-activator id="testServiceActivator" input-channel="inChannel"
output-channel = "outChannel" method="foo">
<beans:bean class="org.foo.TestServiceActivator" /> \
</service-activator>]]></programlisting>
</para>
<note>
<para>
Using both "ref" attribute and inner handler definition in the same <code>&lt;service-activator&gt;</code> configuration
is not allowed, as it creates an ambiguous condition and will result in Exception being thrown
</para>
</note>
</section>
</chapter>