finished stream.xml and removed obsolete info from adapters

This commit is contained in:
Iwein Fuld
2008-10-18 21:02:50 +00:00
parent 8e12a8d9e2
commit fdd0bef28e
3 changed files with 38 additions and 31 deletions

View File

@@ -143,27 +143,6 @@ marshallingHandler = new MarshallingWebServiceHandler(uri, marshaller);
<ulink url="http://static.springframework.org/spring-ws/site/reference/html/oxm.html">Object/XML mapping</ulink>.
</para>
</section>
<section id="adapters-stream">
<title>Stream Adapters</title>
<para>
Spring Integration also provides adapters for streams. Both <classname>ByteStreamSource</classname> and
<classname>CharacterStreamSource</classname> implement the <interfacename>PollableSource</interfacename>
interface. By configuring one of these within a channel-adapter element, the polling period can be configured,
and the Message Bus can automatically detect and schedule them. The byte stream version requires an
<classname>InputStream</classname>, and the character stream version requires a <classname>Reader</classname> as
the single constructor argument. The <classname>ByteStreamSource</classname> also accepts the 'bytesPerMessage'
property to determine how many bytes it will attempt to read into each <interfacename>Message</interfacename>.
</para>
<para>
For target streams, there are also two implementations: <classname>ByteStreamTarget</classname> and
<classname>CharacterStreamTarget</classname>. Each requires a single constructor argument -
<classname>OutputStream</classname> for byte streams or <classname>Writer</classname> for character streams,
and each provides a second constructor that adds the optional 'bufferSize' property. Since both of these
ultimately implement the <interfacename>MessageTarget</interfacename> interface, they can be referenced from a
<emphasis>channel-adapter</emphasis> configuration as will be described in more detail in
<xref linkend="namespace-endpoint"/>.
</para>
</section>
<section id="adapters-applicationevents">
<title>ApplicationEvent Adapters</title>
<para>

View File

@@ -44,7 +44,8 @@
<xi:include href="./aggregator-resequencer.xml"/>
<xi:include href="./adapters.xml"/>
<xi:include href="./file.xml"/>
<xi:include href="./rmi.xml"/>
<xi:include href="./rmi.xml"/>
<xi:include href="./stream.xml"/>
<xi:include href="./configuration.xml"/>
<xi:include href="./samples.xml"/>
<xi:include href="./resources.xml"/>

View File

@@ -6,7 +6,7 @@
<section id="stream-intro">
<title>Introduction</title>
<para>
In many cases application data is obtained from a stream. It is <emphasize>not</emphasize> recommended to send a reference to a Stream as a message payload to a consumer. Instead messages are created from data that is read from an input stream and message payloads are written to an output stream one by one.
In many cases application data is obtained from a stream. It is <emphasis>not</emphasis> recommended to send a reference to a Stream as a message payload to a consumer. Instead messages are created from data that is read from an input stream and message payloads are written to an output stream one by one.
</para>
</section>
@@ -22,7 +22,7 @@
property to determine how many bytes it will attempt to read into each <interfacename>Message</interfacename>. The
default value is 1024
<programlisting language="xml"><![CDATA[<bean class="org.springframework.integration.stream.ByteStreamSource">
<constructor-arg value="someInputStream"/>
<constructor-arg ref="someInputStream"/>
<property name="bytesPerMessage" value="2048"/>
</bean>
@@ -39,11 +39,18 @@
For target streams, there are also two implementations: <classname>ByteStreamWritingMessageConsumer</classname> and
<classname>CharacterStreamWritingMessageConsumer</classname>. Each requires a single constructor argument -
<classname>OutputStream</classname> for byte streams or <classname>Writer</classname> for character streams,
and each provides a second constructor that adds the optional 'bufferSize' property. Since both of these
and each provides a second constructor that adds the optional 'bufferSize'. Since both of these
ultimately implement the <interfacename>MessageConsumer</interfacename> interface, they can be referenced from a
<emphasis>channel-adapter</emphasis> configuration as will be described in more detail in
<xref linkend="namespace-endpoint"/>.
<programlisting language="xml"><![CDATA[]]>
<programlisting language="xml"><![CDATA[<bean class="org.springframework.integration.stream.ByteStreamWritingMessageConsumer">
<constructor-arg ref="someOutputStream"/>
<constructor-arg value="1024"/>
</bean>
<bean class="org.springframework.integration.stream.CharacterStreamWritingMessageConsumer">
<constructor-arg ref="someWriter"/>
</bean>]]>
</programlisting>
</para>
</section>
@@ -51,14 +58,34 @@
<section id="stream-namespace">
<title>HttpInvoker namespace support</title>
<title>Stream namespace support</title>
<para>
To reduce the configuration needed for stream related channel adapters there is a namespace defined. The following schema locations are needed to use it.
<programlisting language="xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/stream"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/integration/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd">]]></programlisting>
</para>
<para>
To configure the inbound gateway you can choose to use the namespace support for it. The following code snippet shows the different configuration options that are supported.
<programlisting language="xml"><![CDATA[]]></programlisting>
To configure the inbound channel adapter the following code snippet shows the different configuration options that are supported.
<programlisting language="xml"><![CDATA[<stdin-channel-adapter id="adapterWithDefaultCharset"/>
<stdin-channel-adapter id="adapterWithProvidedCharset" charset="UTF-8"/>]]></programlisting>
</para>
<para>
To configure the outbound gateway you can use the namespace support as well. The following code snippet shows the different configuration for an outbound HttpInvoker gateway.
<programlisting language="xml"><![CDATA[]]></programlisting>
To configure the outbound channel adapter you can use the namespace support as well. The following code snippet shows the different configuration for an outbound channel adapters.
<programlisting language="xml"><![CDATA[<stdout-channel-adapter id="stdoutAdapterWithDefaultCharset" channel="testChannel"/>
<stdout-channel-adapter id="stdoutAdapterWithProvidedCharset" charset="UTF-8" channel="testChannel"/>
<stderr-channel-adapter id="stderrAdapter" channel="testChannel"/>
<stdout-channel-adapter id="newlineAdapter" append-newline="true" channel="testChannel"/>
]]></programlisting>
</para>
</section>
</chapter>