diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Filter.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Filter.java index 06b744ebcd..25ae75cf7b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Filter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Filter.java @@ -45,10 +45,26 @@ import java.lang.annotation.Target; @Documented public @interface Filter { + /** + * Specify the channel from which this filter will consume messages. + * If the channel does not exist, a {@code DirectChannel} with this name will be + * registered in the application context. + * @return The channel name. + */ String inputChannel() default ""; + /** + * Specify the channel to which this filter will send messages that pass the + * selector. + * @return The channel name. + */ String outputChannel() default ""; + /** + * Specify the channel to which this filter will send messages that do no pass the + * selector. + * @return The channel name. + */ String discardChannel() default ""; /** @@ -59,6 +75,11 @@ public @interface Filter { */ String throwExceptionOnRejection() default ""; + /** + * Specify a "chain" of {@code Advice} beans that will "wrap" the message handler. + * Only the handler is advised, not the downstream flow. + * @return the advice chain. + */ String[] adviceChain() default {}; /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Gateway.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Gateway.java index 85defd9707..4aa5436ee7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Gateway.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Gateway.java @@ -63,16 +63,46 @@ import java.lang.annotation.Target; @Documented public @interface Gateway { + /** + * Specify the channel to which messages will be sent; overrides the encompassing + * gateway's default request channel. + * @return the channel name. + */ String requestChannel() default ""; + /** + * Specify the channel from which reply messages will be received; overrides the + * encompassing gateway's default reply channel. + * @return the channel name. + */ String replyChannel() default ""; + /** + * Specify the timeout (ms) when sending to the request channel - only applies if the + * send might block (such as a bounded {@code QueueChannel} that is currently full. + * Overrides the encompassing gatewsy's default request timeout. + * @return the timeout. + */ long requestTimeout() default Long.MIN_VALUE; + /** + * Specify the time (ms) that the thread sending the request will wait for a reply. + * The timer starts when the thread returns to the gateway, not when the request + * message is sent. Overrides the encompassing gateway's default reply timeout. + * @return the timeout. + */ long replyTimeout() default Long.MIN_VALUE; + /** + * Specify a SpEL expression to determine the payload of the request message. + * @return the expression. + */ String payloadExpression() default ""; + /** + * Specify additional headers that will be added to the request message. + * @return the headers. + */ GatewayHeader[] headers() default {}; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Router.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Router.java index db725b66a2..30c7e70a20 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Router.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Router.java @@ -51,19 +51,38 @@ import java.lang.annotation.Target; @Documented public @interface Router { + /** + * Specify the channel from which this router will consume messages. + * If the channel does not exist, a {@code DirectChannel} with this name will be + * registered in the application context. + * @return The channel name. + */ String inputChannel() default ""; + /** + * Specify the channel to which this router will send messages for which destination + * channels are not resolved and {@link #resolutionRequired()} is false. + * @return The channel name. + */ String defaultOutputChannel() default ""; /** * The 'key=value' pairs to represent channelMapping entries - * @return the channelMappings + * @return the channelMappings. * @see org.springframework.integration.router.AbstractMappingMessageRouter#setChannelMapping(String, String) */ String[] channelMappings() default {}; + /** + * Specify a prefix to be added to each channel name prior to resolution. + * @return the prefix. + */ String prefix() default ""; + /** + * Specify a suffix to be added to each channel name prior to resolution. + * @return the suffix. + */ String suffix() default ""; /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/ServiceActivator.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/ServiceActivator.java index 23b4a0b34f..4750d7e84a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/ServiceActivator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/ServiceActivator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -48,8 +48,18 @@ import java.lang.annotation.Target; @Documented public @interface ServiceActivator { + /** + * Specify the channel from which this service activator will consume messages. + * If the channel does not exist, a {@code DirectChannel} with this name will be + * registered in the application context. + * @return The channel name. + */ String inputChannel() default ""; + /** + * Specify the channel to which this service activator will send any replies. + * @return The channel name. + */ String outputChannel() default ""; /** @@ -62,6 +72,11 @@ public @interface ServiceActivator { */ String requiresReply() default ""; + /** + * Specify a "chain" of {@code Advice} beans that will "wrap" the message handler. + * Only the handler is advised, not the downstream flow. + * @return the advice chain. + */ String[] adviceChain() default {}; /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Splitter.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Splitter.java index 2b4b15efb5..926718b5f8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Splitter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Splitter.java @@ -47,8 +47,18 @@ import java.lang.annotation.Target; @Documented public @interface Splitter { + /** + * Specify the channel from which this splitter will consume messages. + * If the channel does not exist, a {@code DirectChannel} with this name will be + * registered in the application context. + * @return The channel name. + */ String inputChannel() default ""; + /** + * Specify the channel to which this splitter will send any replies. + * @return The channel name. + */ String outputChannel() default ""; /** @@ -63,6 +73,11 @@ public @interface Splitter { */ String applySequence() default ""; + /** + * Specify a "chain" of {@code Advice} beans that will "wrap" the message handler. + * Only the handler is advised, not the downstream flow. + * @return the advice chain. + */ String[] adviceChain() default {}; /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Transformer.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Transformer.java index 9940690a83..f5fbe4a57d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Transformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Transformer.java @@ -37,10 +37,25 @@ import java.lang.annotation.Target; @Documented public @interface Transformer { + /** + * Specify the channel from which this transformer will consume messages. + * If the channel does not exist, a {@code DirectChannel} with this name will be + * registered in the application context. + * @return The channel name. + */ String inputChannel() default ""; + /** + * Specify the channel to which this transformer will send the transformed message. + * @return The channel name. + */ String outputChannel() default ""; + /** + * Specify a "chain" of {@code Advice} objects that will "wrap" the message handler. + * Only the handler is advised, not the downstream flow. + * @return the advice chain. + */ String[] adviceChain() default {}; /**