diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/channel/ChannelInterceptor.java b/org.springframework.integration/src/main/java/org/springframework/integration/channel/ChannelInterceptor.java index 1b8acafdcb..1e5f9b2822 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/channel/ChannelInterceptor.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/channel/ChannelInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,12 +28,32 @@ import org.springframework.integration.core.MessageChannel; */ public interface ChannelInterceptor { + /** + * Invoked before the Message is actually sent to the channel. + * This allows for modification of the Message if necessary. + * If this method returns null, then the actual + * send invocation will not occur. + */ Message preSend(Message message, MessageChannel channel); + /** + * Invoked immediately after the send invocation. The boolean + * value argument represents the return value of that invocation. + */ void postSend(Message message, MessageChannel channel, boolean sent); + /** + * Invoked as soon as receive is called and before a Message is + * actually retrieved. If the return value is 'false', then no + * Message will be retrieved. This only applies to PollableChannels. + */ boolean preReceive(MessageChannel channel); + /** + * Invoked immediately after a Message has been retrieved but before + * it is returned to the caller. The Message may be modified if + * necessary. This only applies to PollableChannels. + */ Message postReceive(Message message, MessageChannel channel); } diff --git a/org.springframework.integration/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd b/org.springframework.integration/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd index f53a11032a..ec636c43fb 100644 --- a/org.springframework.integration/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd +++ b/org.springframework.integration/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd @@ -67,7 +67,13 @@ + minOccurs="0" maxOccurs="1"> + + + + @@ -203,7 +209,15 @@ + minOccurs="0" maxOccurs="1"> + + + + @@ -1443,9 +1457,7 @@ - Defines a list of interceptors. Each element may - be a ChannelInterceptor, - ref, or inner-bean. + Defines a list of interceptors. Each element may be a ChannelInterceptor, ref, or inner-bean. @@ -1474,7 +1486,7 @@ - Defines a Wire Tap Channel Interceptor. + Defines a Wire Tap Channel Interceptor. @@ -1582,8 +1594,8 @@ - Defines a MessagePublishingInterceptor which allows you to generate messages as a by-product of - method invocations on Spring configured components. + Defines a MessagePublishingInterceptor which allows you to generate messages + as a by-product of method invocations on Spring configured components. @@ -1601,7 +1613,7 @@