From f5fe76d7155122bbcc11dbd825c3129cda12ceb1 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Wed, 13 Oct 2010 22:08:12 -0400 Subject: [PATCH] INT-1382 added simple 'expression' sub-element description to the 'filter' chapter --- src/docbkx/filter.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/docbkx/filter.xml b/src/docbkx/filter.xml index 7da324e52e..d0da4b7915 100644 --- a/src/docbkx/filter.xml +++ b/src/docbkx/filter.xml @@ -97,6 +97,36 @@ ]]> + If the Expression itself needs to be dynamic, then an 'expression' sub-element may be used. That provides a level of + indirection for resolving the Expression by its key from an ExpressionSource. That is a strategy interface that you + can implement directly, or you can rely upon a version available in Spring Integration that loads Expressions from + a "resource bundle" and can check for modifications after a given number of seconds. All of this is demonstrated in + the following configuration sample where the Expression could be reloaded within one minute if the underlying file + had been modified. If the ExpressionSource bean is named "expressionSource", then it is not necessary to provide the + "source" attribute on the <expression> element, but in this case it's shown for completeness. + + + + + + + + + +]]> + + Then, the 'config/integration/expressions.properties' file (or any more specific version with a locale extension + to be resolved in the typical way that resource-bundles are loaded) would contain a key/value pair: + + 100 +]]> + + All of the examples that use "expression" as an attribute or sub-element can also be applied within + transformer, router, splitter, service-activator, and header-enricher elements. Of course, the semantics/role + of the given component type would affect the interpretation of the evaluation result in the same way that the + return or a method-invocation would be interpreted. For example, an expression can return Strings that are + to be treated as Message Channel names by a router component. \ No newline at end of file