From f48624f603f5e366a1f07e2f478302bfb998efde Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Fri, 12 Nov 2010 10:01:44 -0500 Subject: [PATCH] INT-1516 added docs for service-activator and SpEL --- .../reference/docbook/service-activator.xml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/src/reference/docbook/service-activator.xml b/docs/src/reference/docbook/service-activator.xml index 4ccadc3f80..a01fb587ca 100644 --- a/docs/src/reference/docbook/service-activator.xml +++ b/docs/src/reference/docbook/service-activator.xml @@ -66,6 +66,35 @@ configuration is not allowed, as it creates an ambiguous condition and will result in an Exception being thrown. + + + Service Activators and Spring Expression Language (SpEL) + + + + Since Spring Integration 2.0 Service Activators can also benefit from SpEL ()http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/expressions.html + in several ways. + + + First, you may now invoke any bean method without pointing to this bean via ref attribute or including it as an + inner definition. For example: + + + + ]]> + + In the above configuration instead of injecting 'accountService' using ref or as inner bean we are simply using @beanId + notation and invoking a method which takes the type compatible with Message payload. + + For simple scenarios your Service Activators do not even have to reference a bean if all logic can be encapsulated + by such expression. + + ]]> + In the above configuration our service logic is to simply multiply the payload value by 2 and SpEL lets us handle it relatively easy. + + +