INT-3911: Restore removed @Deprecated
JIRA: https://jira.spring.io/browse/INT-3911 Deffer the removal to `5.0`
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2002-2015 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. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.aggregator;
|
||||
|
||||
import org.springframework.integration.store.MessageGroup;
|
||||
|
||||
/**
|
||||
* This implementation of MessageGroupProcessor will return all messages inside the group.
|
||||
* This is useful if there is no requirement to process the messages, but they should just be
|
||||
* blocked as a group until their ReleaseStrategy lets them pass through.
|
||||
*
|
||||
* @deprecated since 4.2; use {@link SimpleMessageGroupProcessor}
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Deprecated
|
||||
public class PassThroughMessageGroupProcessor implements MessageGroupProcessor {
|
||||
|
||||
@Override
|
||||
public Object processMessageGroup(MessageGroup group) {
|
||||
return group.getMessages();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation indicating that a method parameter's value should be
|
||||
* retrieved from the message headers. The value of the annotation
|
||||
* can either be a header name (e.g., 'foo') or SpEL expression
|
||||
* (e.g., 'payload.getCustomerId()') which is quite useful when
|
||||
* the name of the header has to be dynamically computed. It also
|
||||
* provides an optional 'required' property which
|
||||
* specifies whether the attribute value must be available within
|
||||
* the header. The default value for 'required' is <code>true</code>.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*
|
||||
* @deprecated since 4.1 in favor of {@link org.springframework.messaging.handler.annotation.Header}.
|
||||
* Will be removed in a future release.
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Deprecated
|
||||
public @interface Header {
|
||||
|
||||
String value() default "";
|
||||
|
||||
boolean required() default true;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation indicating that a method parameter's value should be mapped to or
|
||||
* from the message headers. The annotated parameter must be assignable to
|
||||
* {@link java.util.Map}, and all of the Map's keys must be Strings.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*
|
||||
* @deprecated since 4.1 in favor of {@link org.springframework.messaging.handler.annotation.Headers}.
|
||||
* Will be removed in a future release.
|
||||
*/
|
||||
@Target(ElementType.PARAMETER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Deprecated
|
||||
public @interface Headers {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2002-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* This annotation allows you to specify a SpEL expression indicating that a method
|
||||
* parameter's value should be mapped from the payload of a Message. The expression
|
||||
* will be evaluated against the payload object as the root context. The annotated
|
||||
* parameter type must match or be convertible from the evaluation result.
|
||||
* <p>
|
||||
* Example: void foo(@Payload("city.name") String cityName) - will map the value of
|
||||
* the 'name' property of the 'city' property of the payload object.
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.0
|
||||
*
|
||||
* @deprecated since 4.1 in favor of {@link org.springframework.messaging.handler.annotation.Payload}.
|
||||
* Will be removed in a future release.
|
||||
*/
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Deprecated
|
||||
public @interface Payload {
|
||||
|
||||
/**
|
||||
* @return The expression for matching against nested properties of the payload.
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
}
|
||||
@@ -72,9 +72,14 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
|
||||
return (StringUtils.hasText(channelName) ? channelName : null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public String getPayloadExpression(Method method) {
|
||||
String payloadExpression = null;
|
||||
Annotation methodPayloadAnnotation = AnnotationUtils.findAnnotation(method, Payload.class);
|
||||
Annotation methodPayloadAnnotation =
|
||||
AnnotationUtils.findAnnotation(method, org.springframework.integration.annotation.Payload.class);
|
||||
if (methodPayloadAnnotation == null) {
|
||||
methodPayloadAnnotation = AnnotationUtils.findAnnotation(method, Payload.class);
|
||||
}
|
||||
|
||||
if (methodPayloadAnnotation != null) {
|
||||
payloadExpression = getAnnotationValue(methodPayloadAnnotation, null, String.class);
|
||||
@@ -87,7 +92,8 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
|
||||
for (int i = 0; i < annotationArray.length; i++) {
|
||||
Annotation[] parameterAnnotations = annotationArray[i];
|
||||
for (Annotation currentAnnotation : parameterAnnotations) {
|
||||
if (Payload.class.equals(currentAnnotation.annotationType())) {
|
||||
if (org.springframework.integration.annotation.Payload.class.equals(currentAnnotation.annotationType())
|
||||
|| Payload.class.equals(currentAnnotation.annotationType())) {
|
||||
Assert.state(payloadExpression == null,
|
||||
"@Payload can be used at most once on a @Publisher method, " +
|
||||
"either at method-level or on a single parameter");
|
||||
@@ -101,11 +107,12 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
|
||||
|| payloadExpression.contains("#" + PublisherMetadataSource.RETURN_VALUE_VARIABLE_NAME)) {
|
||||
Assert.isTrue(!void.class.equals(method.getReturnType()),
|
||||
"When defining @Publisher on a void-returning method, an explicit payload " +
|
||||
"expression that does not rely upon a #return value is required.");
|
||||
"expression that does not rely upon a #return value is required.");
|
||||
}
|
||||
return payloadExpression;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public Map<String, String> getHeaderExpressions(Method method) {
|
||||
Map<String, String> headerExpressions = new HashMap<String, String>();
|
||||
String[] parameterNames = this.parameterNameDiscoverer.getParameterNames(method);
|
||||
@@ -113,7 +120,8 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
|
||||
for (int i = 0; i < annotationArray.length; i++) {
|
||||
Annotation[] parameterAnnotations = annotationArray[i];
|
||||
for (Annotation currentAnnotation : parameterAnnotations) {
|
||||
if (Header.class.equals(currentAnnotation.annotationType())) {
|
||||
if (org.springframework.integration.annotation.Header.class.equals(currentAnnotation.annotationType())
|
||||
|| Header.class.equals(currentAnnotation.annotationType())) {
|
||||
String name = getAnnotationValue(currentAnnotation, null, String.class);
|
||||
if (!StringUtils.hasText(name)) {
|
||||
name = parameterNames[i];
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.ManagedSet;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
@@ -185,8 +186,13 @@ public class IntegrationRegistrar implements ImportBeanDefinitionRegistrar, Bean
|
||||
new BeanDefinitionHolder(integrationEvaluationContextBuilder.getBeanDefinition(),
|
||||
IntegrationContextUtils.INTEGRATION_EVALUATION_CONTEXT_BEAN_NAME);
|
||||
|
||||
BeanDefinitionReaderUtils.registerBeanDefinition(integrationEvaluationContextHolder,
|
||||
registry);
|
||||
BeanDefinitionReaderUtils.registerBeanDefinition(integrationEvaluationContextHolder, registry);
|
||||
|
||||
//TODO Remove this registration in 5.0
|
||||
RootBeanDefinition integrationEvalContextBPP =
|
||||
new RootBeanDefinition(IntegrationConfigUtils.BASE_PACKAGE +
|
||||
".expression.IntegrationEvaluationContextAwareBeanPostProcessor");
|
||||
BeanDefinitionReaderUtils.registerWithGeneratedName(integrationEvalContextBPP, registry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,13 +65,13 @@ import org.springframework.util.StringUtils;
|
||||
public abstract class IntegrationObjectSupport implements BeanNameAware, NamedComponent,
|
||||
ApplicationContextAware, BeanFactoryAware, InitializingBean {
|
||||
|
||||
protected static final ExpressionParser EXPRESSION_PARSER = new SpelExpressionParser();
|
||||
|
||||
/**
|
||||
* Logger that is available to subclasses
|
||||
*/
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
protected final ExpressionParser EXPRESSION_PARSER = new SpelExpressionParser();
|
||||
|
||||
private final ConversionService defaultConversionService = new DefaultConversionService();
|
||||
|
||||
private volatile DestinationResolver<MessageChannel> channelResolver;
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2013 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.expression;
|
||||
|
||||
import org.springframework.expression.EvaluationContext;
|
||||
import org.springframework.integration.context.IntegrationContextUtils;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by beans that wish to be aware of their
|
||||
* owning integration {@link EvaluationContext}, which is the result of
|
||||
* {@link org.springframework.integration.config.IntegrationEvaluationContextFactoryBean}
|
||||
* <p>
|
||||
* The {@link #setIntegrationEvaluationContext} is invoked from
|
||||
* the {@code IntegrationEvaluationContextAwareBeanPostProcessor#afterSingletonsInstantiated()},
|
||||
* not during standard {@code postProcessBefore(After)Initialization} to avoid any
|
||||
* {@code BeanFactory} early access during integration {@link EvaluationContext} retrieval.
|
||||
* Therefore, if it is necessary to use {@link EvaluationContext} in the {@code afterPropertiesSet()},
|
||||
* the {@code IntegrationContextUtils.getEvaluationContext(this.beanFactory)} should be used instead
|
||||
* of this interface implementation.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @since 3.0
|
||||
* @deprecated since 4.2 in favor of {@link IntegrationContextUtils#getEvaluationContext}
|
||||
* direct usage from the {@code afterPropertiesSet} implementation.
|
||||
* Will be removed in the next release.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface IntegrationEvaluationContextAware {
|
||||
|
||||
void setIntegrationEvaluationContext(EvaluationContext evaluationContext);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2013-2015 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.expression;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.SmartInitializingSingleton;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
import org.springframework.integration.context.IntegrationContextUtils;
|
||||
|
||||
/**
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
* @since 3.0
|
||||
* @deprecated since 4.2 in favor of {@link IntegrationContextUtils#getEvaluationContext}
|
||||
* direct usage from the {@code afterPropertiesSet} implementation.
|
||||
* Will be removed in the next release.
|
||||
*/
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
public class IntegrationEvaluationContextAwareBeanPostProcessor
|
||||
implements BeanPostProcessor, Ordered, BeanFactoryAware, SmartInitializingSingleton {
|
||||
|
||||
private final List<IntegrationEvaluationContextAware> evaluationContextAwares =
|
||||
new ArrayList<IntegrationEvaluationContextAware>();
|
||||
|
||||
private volatile BeanFactory beanFactory;
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (bean instanceof IntegrationEvaluationContextAware) {
|
||||
this.evaluationContextAwares.add((IntegrationEvaluationContextAware) bean);
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterSingletonsInstantiated() {
|
||||
StandardEvaluationContext evaluationContext = IntegrationContextUtils.getEvaluationContext(this.beanFactory);
|
||||
for (IntegrationEvaluationContextAware evaluationContextAware : this.evaluationContextAwares) {
|
||||
evaluationContextAware.setIntegrationEvaluationContext(evaluationContext);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return LOWEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -244,9 +244,13 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
return parameterList;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static Expression parsePayloadExpression(Method method) {
|
||||
Expression expression = null;
|
||||
Annotation payload = method.getAnnotation(Payload.class);
|
||||
Annotation payload = method.getAnnotation(org.springframework.integration.annotation.Payload.class);
|
||||
if (payload == null) {
|
||||
payload = method.getAnnotation(Payload.class);
|
||||
}
|
||||
if (payload != null) {
|
||||
String expressionString = (String) AnnotationUtils.getValue(payload);
|
||||
Assert.hasText(expressionString,
|
||||
@@ -259,6 +263,7 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
public class DefaultMethodArgsMessageMapper implements MethodArgsMessageMapper {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public Message<?> toMessage(MethodArgsHolder holder) throws Exception {
|
||||
Object messageOrPayload = null;
|
||||
boolean foundPayloadAnnotation = false;
|
||||
@@ -275,7 +280,8 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
Annotation annotation =
|
||||
MessagingAnnotationUtils.findMessagePartAnnotation(methodParameter.getParameterAnnotations(), false);
|
||||
if (annotation != null) {
|
||||
if (annotation.annotationType().equals(Payload.class)) {
|
||||
if (annotation.annotationType().equals(org.springframework.integration.annotation.Payload.class)
|
||||
|| annotation.annotationType().equals(Payload.class)) {
|
||||
if (messageOrPayload != null) {
|
||||
GatewayMethodInboundMessageMapper.this.throwExceptionForMultipleMessageOrPayloadParameters(methodParameter);
|
||||
}
|
||||
@@ -289,7 +295,8 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
}
|
||||
foundPayloadAnnotation = true;
|
||||
}
|
||||
else if (annotation.annotationType().equals(Header.class)) {
|
||||
else if (annotation.annotationType().equals(org.springframework.integration.annotation.Header.class)
|
||||
|| annotation.annotationType().equals(Header.class)) {
|
||||
String headerName =
|
||||
GatewayMethodInboundMessageMapper.this.determineHeaderName(annotation, methodParameter);
|
||||
if ((Boolean) AnnotationUtils.getValue(annotation, "required") && argumentValue == null) {
|
||||
@@ -298,7 +305,8 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
}
|
||||
headers.put(headerName, argumentValue);
|
||||
}
|
||||
else if (annotation.annotationType().equals(Headers.class)) {
|
||||
else if (annotation.annotationType().equals(org.springframework.integration.annotation.Headers.class)
|
||||
|| annotation.annotationType().equals(Headers.class)) {
|
||||
if (argumentValue != null) {
|
||||
if (!(argumentValue instanceof Map)) {
|
||||
throw new IllegalArgumentException("@Headers annotation is only valid for Map-typed parameters");
|
||||
|
||||
@@ -399,7 +399,10 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint
|
||||
boolean shouldReply = returnType != void.class;
|
||||
int paramCount = method.getParameterTypes().length;
|
||||
Object response = null;
|
||||
boolean hasPayloadExpression = method.isAnnotationPresent(Payload.class);
|
||||
@SuppressWarnings("deprecation")
|
||||
boolean hasPayloadExpression =
|
||||
method.isAnnotationPresent(org.springframework.integration.annotation.Payload.class)
|
||||
|| method.isAnnotationPresent(Payload.class);
|
||||
if (!hasPayloadExpression && this.methodMetadataMap != null) {
|
||||
// check for the method metadata next
|
||||
GatewayMethodMetadata metadata = this.methodMetadataMap.get(method.getName());
|
||||
|
||||
@@ -113,8 +113,11 @@ public final class MessagingAnnotationUtils {
|
||||
Annotation match = null;
|
||||
for (Annotation annotation : annotations) {
|
||||
Class<? extends Annotation> type = annotation.annotationType();
|
||||
if (type.equals(Payload.class)
|
||||
if (type.equals(org.springframework.integration.annotation.Payload.class)
|
||||
|| type.equals(Payload.class)
|
||||
|| type.equals(org.springframework.integration.annotation.Header.class)
|
||||
|| type.equals(Header.class)
|
||||
|| type.equals(org.springframework.integration.annotation.Headers.class)
|
||||
|| type.equals(Headers.class)
|
||||
|| (payloads && type.equals(Payloads.class))) {
|
||||
if (match != null) {
|
||||
|
||||
@@ -714,7 +714,8 @@ public class MessagingMethodInvokerHelper<T> extends AbstractExpressionEvaluator
|
||||
MessagingAnnotationUtils.findMessagePartAnnotation(parameterAnnotations[i], true);
|
||||
if (mappingAnnotation != null) {
|
||||
Class<? extends Annotation> annotationType = mappingAnnotation.annotationType();
|
||||
if (annotationType.equals(Payload.class)) {
|
||||
if (annotationType.equals(org.springframework.integration.annotation.Payload.class)
|
||||
|| annotationType.equals(Payload.class)) {
|
||||
sb.append("payload");
|
||||
String qualifierExpression = (String) AnnotationUtils.getValue(mappingAnnotation);
|
||||
if (StringUtils.hasText(qualifierExpression)) {
|
||||
@@ -735,12 +736,14 @@ public class MessagingMethodInvokerHelper<T> extends AbstractExpressionEvaluator
|
||||
this.setExclusiveTargetParameterType(parameterTypeDescriptor, methodParameter);
|
||||
}
|
||||
}
|
||||
else if (annotationType.equals(Headers.class)) {
|
||||
else if (annotationType.equals(org.springframework.integration.annotation.Headers.class)
|
||||
|| annotationType.equals(Headers.class)) {
|
||||
Assert.isTrue(Map.class.isAssignableFrom(parameterType),
|
||||
"The @Headers annotation can only be applied to a Map-typed parameter.");
|
||||
sb.append("headers");
|
||||
}
|
||||
else if (annotationType.equals(Header.class)) {
|
||||
else if (annotationType.equals(org.springframework.integration.annotation.Header.class)
|
||||
|| annotationType.equals(Header.class)) {
|
||||
sb.append(this.determineHeaderExpression(mappingAnnotation, methodParameter));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user