From e6c63cfb0bc9688c4049a5dae50dc055c800decc Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Mon, 11 Aug 2008 14:09:57 +0000 Subject: [PATCH] SimpleEndpoint provides the ChannelRegistry reference to its handler if that handler implements ChannelRegistryAware. --- .../springframework/integration/endpoint/SimpleEndpoint.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/endpoint/SimpleEndpoint.java b/org.springframework.integration/src/main/java/org/springframework/integration/endpoint/SimpleEndpoint.java index 0ef0bdca42..c2a7eaf91f 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/endpoint/SimpleEndpoint.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/endpoint/SimpleEndpoint.java @@ -24,6 +24,7 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanNameAware; import org.springframework.integration.channel.ChannelRegistry; +import org.springframework.integration.channel.ChannelRegistryAware; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.message.CompositeMessage; @@ -120,6 +121,9 @@ public class SimpleEndpoint implements MessageTarget, } public void setChannelRegistry(ChannelRegistry channelRegistry) { + if (this.handler instanceof ChannelRegistryAware) { + ((ChannelRegistryAware) this.handler).setChannelRegistry(channelRegistry); + } this.channelRegistry = channelRegistry; }