removed file and rmi references from adapters.xml\nadded title to file.xml

This commit is contained in:
Iwein Fuld
2008-10-15 17:06:22 +00:00
parent 11e3fbb584
commit 56b4262367
2 changed files with 1 additions and 71 deletions

View File

@@ -82,77 +82,6 @@
Integration's namespace support.
</para>
</section>
<section id="adapters-rmi">
<title>RMI Adapters</title>
<para>
The <classname>RmiGateway</classname> is built upon Spring's <classname>RmiServiceExporter</classname>.
However, since it is adapting a <interfacename>MessageChannel</interfacename>, there is no need to specify
the <emphasis>serviceInterface</emphasis>. Likewise, the <emphasis>serviceName</emphasis> is automatically
generated based on the channel name. Therefore, creating the adapter is as simple as providing a reference
to its channel: <programlisting language="java">RmiGateway rmiGateway = new RmiGateway(channel);
</programlisting>
</para>
<para>
The <classname>RmiHandler</classname> encapsulates the creation of a proxy that is capable of
communicating with an <classname>RmiGateway</classname> running in another process. Since the interface
is already known, the only required information is the URL. The URL should include the host, port (default is
'1099'), and 'serviceName'. The 'serviceName' must match that created by the
<classname>RmiGateway</classname> (the prefix is available as a constant).
<programlisting language="java">String url = "http://somehost:1099/" + RmiGateway.SERVICE_NAME_PREFIX + "someChannel";
RmiHandler rmiHandler = new RmiHandler(url);
</programlisting>
</para>
</section>
<section id="adapters-httpinvoker">
<title>HttpInvoker Adapters</title>
<para>
The adapters for HttpInvoker are very similar to the RMI adapters. For a source, only the
channel needs to be provided, and for a target, only the URL. If running in a Spring MVC environment, then
the <classname>HttpInvokerGateway</classname> simply needs to be defined and provided in a
<interfacename>HandlerMapping</interfacename>. For example, the following would be exposed at the path
"http://somehost/path-mapped-to-dispatcher-servlet/httpInvokerAdapter" when a simple
<classname>BeanNameUrlHandlerMapping</classname> strategy is enabled:
<programlisting language="xml"><![CDATA[<bean name="/httpInvokerAdapter"
class="org.springframework.integration.adapter.httpinvoker.HttpInvokerGateway">
<constructor-arg ref="someChannel"/>
</bean>]]></programlisting>
When not running in a Spring MVC application, simply define a servlet in 'web.xml' whose type is
<classname>HttpRequestHandlerServlet</classname> and whose name matches the bean name of the gateway
adapter. As with the <classname>RmiHandler</classname>, the
<classname>HttpInvokerHandler</classname> only requires the URL that matches an instance of
<classname>HttpInvokerGateway</classname> running in a web application.
</para>
</section>
<section id="adapters-file">
<title>File Adapters</title>
<para>
The <classname>FileSource</classname> requires the directory as a constructor argument:
<programlisting language="java">public FileSource(File directory)</programlisting>
It can then be connected to a <interfacename>MessageChannel</interfacename> when referenced from
a "channel-adapter" element.
</para>
<para>
The <classname>FileTarget</classname> constructor also requires the 'directory' argument. The target
adapter also accepts an implementation of the <interfacename>FileNameGenerator</interfacename> strategy that
defines the following method: <programlisting language="java">String generateFileName(Message message)</programlisting>
</para>
</section>
<section id="adapters-ftp">
<title>FTP Adapters</title>
<para>
To poll a directory with FTP, configure an instance of <classname>FtpSource</classname> and then connect
it to a channel by configuring a <classname>channel-adapter</classname>. The <classname>FtpSource</classname>
expects a number of properties for connecting to the FTP server as shown below.
<programlisting language="xml"><![CDATA[<bean id="ftpSource"
class="org.springframework.integration.adapter.ftp.FtpSource">
<property name="host" value="example.org"/>
<property name="username" value="someuser"/>
<property name="password" value="somepassword"/>
<property name="localWorkingDirectory" value="/some/path"/>
<property name="remoteWorkingDirectory" value="/some/path"/>
</bean>]]></programlisting>
</para>
</section>
<section id="adapters-email">
<title>Mail Adapters</title>
<para>

View File

@@ -131,6 +131,7 @@
</para>
</section>
<section id="file-transforming">
<title>File Transformers</title>
<para>
<!-- Introduction -->
To transform data read from the file system to objects and the other