From 952d02d501e09ffcee4eefc08fae7b6cf4e7baee Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Wed, 30 Nov 2011 15:08:52 -0500 Subject: [PATCH] INT-2261 added documentation for Resource Inbound Channel Adapter added resource.xml file --- docs/src/reference/docbook/index.xml | 1 + docs/src/reference/docbook/resource.xml | 88 ++++++++++++++++++++++++ docs/src/reference/docbook/whats-new.xml | 12 ++++ 3 files changed, 101 insertions(+) create mode 100644 docs/src/reference/docbook/resource.xml diff --git a/docs/src/reference/docbook/index.xml b/docs/src/reference/docbook/index.xml index 3481157d6b..c7dc138bad 100644 --- a/docs/src/reference/docbook/index.xml +++ b/docs/src/reference/docbook/index.xml @@ -140,6 +140,7 @@ + diff --git a/docs/src/reference/docbook/resource.xml b/docs/src/reference/docbook/resource.xml new file mode 100644 index 0000000000..7c8efd7d45 --- /dev/null +++ b/docs/src/reference/docbook/resource.xml @@ -0,0 +1,88 @@ + + + Resource Support + +
+ Introduction + + Resource Inbound Channel Adapter builds upon Spring's Resource abstraction to + support greater flexibility across a variety of actual types of underlying resources, such as a file, a URL, + or a class path resource. Therefore, it's similar to but more generic than the + File Inbound Channel Adapter. + +
+ +
+ Resource Inbound Channel Adapter + + Resource Inbound Channel Adapter is a polling adapter that creates a Message + with collection of Resource objects as payload + + + Resource objects are resolved based on the pattern specified using pattern attribute. + The collection of the resolved Resource objects is than sent as a payload with an + outgoing Message. That is one major difference that Resource Inbound Channel Adapter + has with File Inbound Channel Adapter which buffers File objects and sends a single File object per + Message. + + + Below is an example of very simple configuration which will find all files with 'property' + extension in the foo.bar package available on the classpath and will send them as + payload of a Message to resultChannel: + + + +]]> + + + Resource Inbound Channel Adapter relies on + org.springframework.core.io.support.ResourcePatternResolver to resolve provided pattern. + It defaults to an instance of the current ApplicationContext. However you may provide your own + instance of the ResourcePatternResolver using pattern-resolver attribute: + + + + +]]> + + + There may be a use case where you might want to filter resources in addition to what was already + resolved by the ResourcePatternResolver. For example, you may want to prevent resources + that were resolved once to never appear in the collection of resolved resources ever again. On the other hand + your resources might be updated rather often and you DO want them to be picked up again. In other words + there is a valid use case for defining an additional filter as well as use no additional filtering at all. + You can accomplish this by providing your own implementation of org.springframework.integration.util.CollectionFilter + strategy: + { + + Collection filter(Collection unfilteredElements); + +}]]> + + As you can see the CollectionFilter receives a collection of un-filtered Resource + objects and returns a collection of filtered Resource objects. + + + + The default implementation of CollectionFilter used by the Resource Inbound Channel Adapter + is org.springframework.integration.util.AcceptOnceCollectionFilter which remembers the + elements passed in the previous invocation in order to avoid returning those elements more than once. + + + To inject your own implementation of CollectionFilter use filter attribute. + + + + +]]> + + If you don't need any additional filtering and you want to disable default CollectionFilter strategy + simply configure empty filter attribute (e.g., filter="") + +
+ +
diff --git a/docs/src/reference/docbook/whats-new.xml b/docs/src/reference/docbook/whats-new.xml index b16d37b610..b84844315c 100644 --- a/docs/src/reference/docbook/whats-new.xml +++ b/docs/src/reference/docbook/whats-new.xml @@ -92,6 +92,18 @@ For further details please see . + +
+ Support for Spring's Resource abstraction + + As of version 2.1, we've introduced a new Resource Inbound Channel Adapter that builds upon + Spring's Resource abstraction to support greater flexibility across a variety of actual types of + underlying resources, such as a file, a URL, or a class path resource. Therefore, it's similar to but + more generic than the File Inbound Channel Adapter. + + + For further details please see . +
Stored Procedure Components