INT-3913 Remove/resolve deprecation from the past
JIRA: https://jira.spring.io/browse/INT-3913 * Remove deprecated classes and methods/constructors, deprecated XML attributes * Remove `TcpConnectionEventListeningMessageProducer` and rework tests logic to the `ApplicationEventListeningMessageProducer` * Fix several typos * Remove/rework deprecated entities mentioning
This commit is contained in:
committed by
Gary Russell
parent
ea4763faa9
commit
eaed954458
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* 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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* 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 {
|
||||
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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 "";
|
||||
|
||||
}
|
||||
@@ -74,14 +74,9 @@ 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, org.springframework.integration.annotation.Payload.class);
|
||||
if (methodPayloadAnnotation == null) {
|
||||
methodPayloadAnnotation = AnnotationUtils.findAnnotation(method, Payload.class);
|
||||
}
|
||||
Annotation methodPayloadAnnotation = AnnotationUtils.findAnnotation(method, Payload.class);
|
||||
|
||||
if (methodPayloadAnnotation != null) {
|
||||
payloadExpression = getAnnotationValue(methodPayloadAnnotation, null, String.class);
|
||||
@@ -94,8 +89,7 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
|
||||
for (int i = 0; i < annotationArray.length; i++) {
|
||||
Annotation[] parameterAnnotations = annotationArray[i];
|
||||
for (Annotation currentAnnotation : parameterAnnotations) {
|
||||
if (org.springframework.integration.annotation.Payload.class.equals(currentAnnotation.annotationType())
|
||||
|| Payload.class.equals(currentAnnotation.annotationType())) {
|
||||
if (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");
|
||||
@@ -114,7 +108,6 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
|
||||
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);
|
||||
@@ -122,8 +115,7 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
|
||||
for (int i = 0; i < annotationArray.length; i++) {
|
||||
Annotation[] parameterAnnotations = annotationArray[i];
|
||||
for (Annotation currentAnnotation : parameterAnnotations) {
|
||||
if (org.springframework.integration.annotation.Header.class.equals(currentAnnotation.annotationType())
|
||||
|| Header.class.equals(currentAnnotation.annotationType())) {
|
||||
if (Header.class.equals(currentAnnotation.annotationType())) {
|
||||
String name = getAnnotationValue(currentAnnotation, null, String.class);
|
||||
if (!StringUtils.hasText(name)) {
|
||||
name = parameterNames[i];
|
||||
|
||||
@@ -25,7 +25,7 @@ package org.springframework.integration.codec.kryo;
|
||||
public class MessageCodec extends PojoCodec {
|
||||
|
||||
/**
|
||||
* Construct an instance using the default registration ids for messsage
|
||||
* Construct an instance using the default registration ids for message
|
||||
* headers.
|
||||
*/
|
||||
public MessageCodec() {
|
||||
|
||||
@@ -47,32 +47,6 @@ public class CorrelationStrategyFactoryBean implements FactoryBean<CorrelationSt
|
||||
public CorrelationStrategyFactoryBean() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a factory and set up the strategy which clients of the factory will see as its product.
|
||||
* @param target the target object (null if default strategy is acceptable)
|
||||
* @deprecated since {@literal 4.2.5} in favor of appropriate setters
|
||||
* to avoid {@code BeanCurrentlyInCreationException}
|
||||
* during {@code AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()}
|
||||
*/
|
||||
@Deprecated
|
||||
public CorrelationStrategyFactoryBean(Object target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a factory and set up the strategy which clients of the factory will see as its product.
|
||||
* @param target the target object (null if default strategy is acceptable)
|
||||
* @param methodName the method name to invoke in the target (null if it can be inferred)
|
||||
* @deprecated since {@literal 4.2.5} in favor of appropriate setters
|
||||
* to avoid {@code BeanCurrentlyInCreationException}
|
||||
* during {@code AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()}
|
||||
*/
|
||||
@Deprecated
|
||||
public CorrelationStrategyFactoryBean(Object target, String methodName) {
|
||||
this.target = target;
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
public void setTarget(Object target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ 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;
|
||||
@@ -187,12 +186,6 @@ public class IntegrationRegistrar implements ImportBeanDefinitionRegistrar, Bean
|
||||
IntegrationContextUtils.INTEGRATION_EVALUATION_CONTEXT_BEAN_NAME);
|
||||
|
||||
BeanDefinitionReaderUtils.registerBeanDefinition(integrationEvaluationContextHolder, registry);
|
||||
|
||||
//TODO Remove this registration in 5.0
|
||||
RootBeanDefinition integrationEvalContextBPP =
|
||||
new RootBeanDefinition(IntegrationConfigUtils.BASE_PACKAGE +
|
||||
".expression.IntegrationEvaluationContextAwareBeanPostProcessor");
|
||||
BeanDefinitionReaderUtils.registerWithGeneratedName(integrationEvalContextBPP, registry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,32 +51,6 @@ public class ReleaseStrategyFactoryBean implements FactoryBean<ReleaseStrategy>,
|
||||
public ReleaseStrategyFactoryBean() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a factory and set up the strategy which clients of the factory will see as its product.
|
||||
* @param target the target object (null if default strategy is acceptable)
|
||||
* @deprecated since {@literal 4.2.5} in favor of appropriate setters
|
||||
* to avoid {@code BeanCurrentlyInCreationException}
|
||||
* during {@code AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()}
|
||||
*/
|
||||
@Deprecated
|
||||
public ReleaseStrategyFactoryBean(Object target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a factory and set up the strategy which clients of the factory will see as its product.
|
||||
* @param target the target object (null if default strategy is acceptable)
|
||||
* @param methodName the method name to invoke in the target (null if it can be inferred)
|
||||
* @deprecated since {@literal 4.2.5} in favor of appropriate setters
|
||||
* to avoid {@code BeanCurrentlyInCreationException}
|
||||
* during {@code AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()}
|
||||
*/
|
||||
@Deprecated
|
||||
public ReleaseStrategyFactoryBean(Object target, String methodName) {
|
||||
this.target = target;
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
public void setTarget(Object target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
@@ -63,15 +63,6 @@ public class RouterFactoryBean extends AbstractStandardMessageHandlerFactoryBean
|
||||
this.defaultOutputChannelName = defaultOutputChannelName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timeout the timeout.
|
||||
* @deprecated in favor of {@link #setSendTimeout(Long)}.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTimeout(Long timeout) {
|
||||
this.sendTimeout = timeout;
|
||||
}
|
||||
|
||||
public void setSendTimeout(Long timeout) {
|
||||
this.sendTimeout = timeout;
|
||||
}
|
||||
|
||||
@@ -54,15 +54,6 @@ public abstract class ExpressionMessageProducerSupport extends MessageProducerSu
|
||||
this.payloadExpression = EXPRESSION_PARSER.parseExpression(payloadExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param payloadExpression the expression to set.
|
||||
* @deprecated in favor of {@link #setPayloadExpression}.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setExpressionPayload(Expression payloadExpression) {
|
||||
setPayloadExpression(payloadExpression);
|
||||
}
|
||||
|
||||
public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
|
||||
this.evaluationContext = evaluationContext;
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* 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);
|
||||
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -254,13 +254,9 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
return parameterList;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static Expression parsePayloadExpression(Method method) {
|
||||
Expression expression = null;
|
||||
Annotation payload = method.getAnnotation(org.springframework.integration.annotation.Payload.class);
|
||||
if (payload == null) {
|
||||
payload = method.getAnnotation(Payload.class);
|
||||
}
|
||||
Annotation payload = method.getAnnotation(Payload.class);
|
||||
if (payload != null) {
|
||||
String expressionString = (String) AnnotationUtils.getValue(payload);
|
||||
Assert.hasText(expressionString,
|
||||
@@ -273,7 +269,6 @@ 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;
|
||||
@@ -290,23 +285,20 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
Annotation annotation =
|
||||
MessagingAnnotationUtils.findMessagePartAnnotation(methodParameter.getParameterAnnotations(), false);
|
||||
if (annotation != null) {
|
||||
if (annotation.annotationType().equals(org.springframework.integration.annotation.Payload.class)
|
||||
|| annotation.annotationType().equals(Payload.class)) {
|
||||
if (annotation.annotationType().equals(Payload.class)) {
|
||||
if (messageOrPayload != null) {
|
||||
GatewayMethodInboundMessageMapper.this.throwExceptionForMultipleMessageOrPayloadParameters(methodParameter);
|
||||
throwExceptionForMultipleMessageOrPayloadParameters(methodParameter);
|
||||
}
|
||||
String expression = (String) AnnotationUtils.getValue(annotation);
|
||||
if (!StringUtils.hasText(expression)) {
|
||||
messageOrPayload = argumentValue;
|
||||
}
|
||||
else {
|
||||
messageOrPayload =
|
||||
GatewayMethodInboundMessageMapper.this.evaluatePayloadExpression(expression, argumentValue);
|
||||
messageOrPayload = evaluatePayloadExpression(expression, argumentValue);
|
||||
}
|
||||
foundPayloadAnnotation = true;
|
||||
}
|
||||
else if (annotation.annotationType().equals(org.springframework.integration.annotation.Header.class)
|
||||
|| annotation.annotationType().equals(Header.class)) {
|
||||
else if (annotation.annotationType().equals(Header.class)) {
|
||||
String headerName =
|
||||
GatewayMethodInboundMessageMapper.this.determineHeaderName(annotation, methodParameter);
|
||||
if ((Boolean) AnnotationUtils.getValue(annotation, "required") && argumentValue == null) {
|
||||
@@ -315,8 +307,7 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper<Object[]
|
||||
}
|
||||
headers.put(headerName, argumentValue);
|
||||
}
|
||||
else if (annotation.annotationType().equals(org.springframework.integration.annotation.Headers.class)
|
||||
|| annotation.annotationType().equals(Headers.class)) {
|
||||
else if (annotation.annotationType().equals(Headers.class)) {
|
||||
if (argumentValue != null) {
|
||||
if (!(argumentValue instanceof Map)) {
|
||||
throw new IllegalArgumentException("@Headers annotation is only valid for Map-typed parameters");
|
||||
|
||||
@@ -376,7 +376,6 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public Object invoke(final MethodInvocation invocation) throws Throwable {
|
||||
final Class<?> returnType = invocation.getMethod().getReturnType();
|
||||
if (this.asyncExecutor != null && !Object.class.equals(returnType)) {
|
||||
@@ -426,10 +425,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint
|
||||
boolean shouldReply = returnType != void.class;
|
||||
int paramCount = method.getParameterTypes().length;
|
||||
Object response = null;
|
||||
@SuppressWarnings("deprecation")
|
||||
boolean hasPayloadExpression =
|
||||
method.isAnnotationPresent(org.springframework.integration.annotation.Payload.class)
|
||||
|| method.isAnnotationPresent(Payload.class);
|
||||
boolean hasPayloadExpression = method.isAnnotationPresent(Payload.class);
|
||||
if (!hasPayloadExpression && this.methodMetadataMap != null) {
|
||||
// check for the method metadata next
|
||||
GatewayMethodMetadata metadata = this.methodMetadataMap.get(method.getName());
|
||||
@@ -702,7 +698,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint
|
||||
if (t instanceof RuntimeException) {
|
||||
throw (RuntimeException) t;
|
||||
}
|
||||
throw new MessagingException("asynchronous gateway invocation failed", t);
|
||||
throw new MessagingException("Asynchronous gateway invocation failed", t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,16 +89,6 @@ public class LoggingHandler extends AbstractMessageHandler {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a SpEL expression string to use.
|
||||
* @param expressionString the SpEL expression string to use.
|
||||
* @deprecated in favor of {@link #setLogExpressionString(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setExpression(String expressionString) {
|
||||
setLogExpressionString(expressionString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a SpEL expression string to use.
|
||||
* @param expressionString the SpEL expression string to use.
|
||||
|
||||
@@ -92,17 +92,6 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler imple
|
||||
this.defaultOutputChannelName = defaultOutputChannelName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the timeout for sending a message to the resolved channel. By default, there is no timeout, meaning the send
|
||||
* will block indefinitely.
|
||||
* @param timeout The timeout.
|
||||
* @deprecated in favor of {@link #setSendTimeout(long)}.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTimeout(long timeout) {
|
||||
this.messagingTemplate.setSendTimeout(timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the timeout for sending a message to the resolved channel.
|
||||
* By default, there is no timeout, meaning the send will block indefinitely.
|
||||
|
||||
@@ -156,29 +156,6 @@ public abstract class AbstractKeyValueMessageStore extends AbstractMessageGroupS
|
||||
doStore(MESSAGE_GROUP_KEY_PREFIX + groupId, metadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a Message from the group with the provided group ID.
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public MessageGroup removeMessageFromGroup(Object groupId, Message<?> messageToRemove) {
|
||||
Assert.notNull(groupId, "'groupId' must not be null");
|
||||
Assert.notNull(messageToRemove, "'messageToRemove' must not be null");
|
||||
|
||||
UUID id = messageToRemove.getHeaders().getId();
|
||||
removeMessage(id);
|
||||
|
||||
MessageGroupMetadata metadata = getGroupMetadata(groupId);
|
||||
if (metadata != null) {
|
||||
metadata.remove(id);
|
||||
metadata.setLastModified(System.currentTimeMillis());
|
||||
doStore(MESSAGE_GROUP_KEY_PREFIX + groupId, metadata);
|
||||
}
|
||||
|
||||
return getMessageGroup(groupId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) {
|
||||
Assert.notNull(groupId, "'groupId' must not be null");
|
||||
|
||||
@@ -54,17 +54,6 @@ public interface MessageGroupStore extends BasicMessageGroupStore {
|
||||
@ManagedAttribute
|
||||
int getMessageGroupCount();
|
||||
|
||||
/**
|
||||
* Persist the deletion of a single message from the group.
|
||||
* The group is modified to reflect that 'messageToRemove' is no longer present in the group.
|
||||
* @param key The groupId for the group containing the message.
|
||||
* @param messageToRemove The message to be removed.
|
||||
* @return The message Group.
|
||||
* @deprecated in favor of {@link #removeMessagesFromGroup}
|
||||
*/
|
||||
@Deprecated
|
||||
MessageGroup removeMessageFromGroup(Object key, Message<?> messageToRemove);
|
||||
|
||||
/**
|
||||
* Persist the deletion of messages from the group.
|
||||
* @param key The groupId for the group containing the message(s).
|
||||
|
||||
@@ -324,34 +324,6 @@ public class SimpleMessageStore extends AbstractMessageGroupStore
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public MessageGroup removeMessageFromGroup(Object groupId, Message<?> messageToRemove) {
|
||||
Lock lock = this.lockRegistry.obtain(groupId);
|
||||
try {
|
||||
lock.lockInterruptibly();
|
||||
try {
|
||||
MessageGroup group = this.groupIdToMessageGroup.get(groupId);
|
||||
Assert.notNull(group, "MessageGroup for groupId '" + groupId + "' " +
|
||||
"can not be located while attempting to remove Message from the MessageGroup");
|
||||
if (group.remove(messageToRemove)) {
|
||||
UpperBound upperBound = this.groupToUpperBound.get(groupId);
|
||||
Assert.state(upperBound != null, "'upperBound' must not be null.");
|
||||
upperBound.release();
|
||||
group.setLastModified(System.currentTimeMillis());
|
||||
}
|
||||
return group;
|
||||
}
|
||||
finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new MessagingException("Interrupted while obtaining lock", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) {
|
||||
Lock lock = this.lockRegistry.obtain(groupId);
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-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.transformer;
|
||||
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.support.ChannelInterceptor;
|
||||
import org.springframework.messaging.support.ChannelInterceptorAdapter;
|
||||
|
||||
/**
|
||||
* A {@link ChannelInterceptor} which invokes a {@link Transformer}
|
||||
* when either sending-to or receiving-from a channel.
|
||||
*
|
||||
* @deprecated It is not generally recommended to perform functions
|
||||
* such as transformation in a channel interceptor.
|
||||
*
|
||||
* @author Jonas Partner
|
||||
*/
|
||||
@Deprecated
|
||||
public class MessageTransformingChannelInterceptor extends ChannelInterceptorAdapter {
|
||||
|
||||
private final Transformer transformer;
|
||||
|
||||
private volatile boolean transformOnSend = true;
|
||||
|
||||
|
||||
public MessageTransformingChannelInterceptor(Transformer transformer) {
|
||||
this.transformer = transformer;
|
||||
}
|
||||
|
||||
|
||||
public boolean getTransformOnSend() {
|
||||
return this.transformOnSend;
|
||||
}
|
||||
|
||||
public void setTransformOnSend(boolean transformOnSend) {
|
||||
this.transformOnSend = transformOnSend;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Message<?> preSend(Message<?> message, MessageChannel channel) {
|
||||
if (this.transformOnSend) {
|
||||
message = this.transformer.transform(message);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Message<?> postReceive(Message<?> message, MessageChannel channel) {
|
||||
if (!this.transformOnSend) {
|
||||
message = this.transformer.transform(message);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -105,7 +105,6 @@ public final class MessagingAnnotationUtils {
|
||||
* @throws MessagingException if more than one of {@link Payload}, {@link Header}
|
||||
* or {@link Headers} annotations are presented.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Annotation findMessagePartAnnotation(Annotation[] annotations, boolean payloads) {
|
||||
if (annotations == null || annotations.length == 0) {
|
||||
return null;
|
||||
@@ -113,11 +112,8 @@ public final class MessagingAnnotationUtils {
|
||||
Annotation match = null;
|
||||
for (Annotation annotation : annotations) {
|
||||
Class<? extends Annotation> type = annotation.annotationType();
|
||||
if (type.equals(org.springframework.integration.annotation.Payload.class)
|
||||
|| type.equals(Payload.class)
|
||||
|| type.equals(org.springframework.integration.annotation.Header.class)
|
||||
if (type.equals(Payload.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) {
|
||||
|
||||
@@ -697,7 +697,6 @@ public class MessagingMethodInvokerHelper<T> extends AbstractExpressionEvaluator
|
||||
return this.method.toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private Expression generateExpression(Method method) {
|
||||
StringBuilder sb = new StringBuilder("#target." + method.getName() + "(");
|
||||
Class<?>[] parameterTypes = method.getParameterTypes();
|
||||
@@ -714,8 +713,7 @@ public class MessagingMethodInvokerHelper<T> extends AbstractExpressionEvaluator
|
||||
MessagingAnnotationUtils.findMessagePartAnnotation(parameterAnnotations[i], true);
|
||||
if (mappingAnnotation != null) {
|
||||
Class<? extends Annotation> annotationType = mappingAnnotation.annotationType();
|
||||
if (annotationType.equals(org.springframework.integration.annotation.Payload.class)
|
||||
|| annotationType.equals(Payload.class)) {
|
||||
if (annotationType.equals(Payload.class)) {
|
||||
sb.append("payload");
|
||||
String qualifierExpression = (String) AnnotationUtils.getValue(mappingAnnotation);
|
||||
if (StringUtils.hasText(qualifierExpression)) {
|
||||
@@ -736,14 +734,12 @@ public class MessagingMethodInvokerHelper<T> extends AbstractExpressionEvaluator
|
||||
this.setExclusiveTargetParameterType(parameterTypeDescriptor, methodParameter);
|
||||
}
|
||||
}
|
||||
else if (annotationType.equals(org.springframework.integration.annotation.Headers.class)
|
||||
|| annotationType.equals(Headers.class)) {
|
||||
else if (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(org.springframework.integration.annotation.Header.class)
|
||||
|| annotationType.equals(Header.class)) {
|
||||
else if (annotationType.equals(Header.class)) {
|
||||
sb.append(this.determineHeaderExpression(mappingAnnotation, methodParameter));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -785,19 +785,6 @@
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="reactor-environment" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
DEPRECATED with no-op in favor of global JVM-wide Reactor configuration.
|
||||
Provide a reference to 'reactor.core.Environment'
|
||||
to use for any of the interface methods that have a 'reactor.core.composable.Promise' return type.
|
||||
The Reactor's Environment will only be used for those async methods; the sync methods
|
||||
will be invoked in the caller's thread.
|
||||
This attribute is required if any 'service-interface' methods
|
||||
have a 'reactor.core.composable.Promise' return type.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
@@ -3488,17 +3475,6 @@
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="timeout" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Specify the maximum amount of time in milliseconds to wait
|
||||
when sending Messages to the target MessageChannels if blocking
|
||||
is possible (e.g. a bounded queue channel that is currently full).
|
||||
By default the send will block indefinitely.
|
||||
DEPRECATED in favor of 'send-timeout' for consistency with other elements.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="send-timeout" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<service-activator id="serviceActivator" input-channel="input" ref="mock" method="test" send-timeout="123"/>
|
||||
|
||||
<router id="router" input-channel="routerInput" expression="'someChannel'" timeout="123"/>
|
||||
<router id="router" input-channel="routerInput" expression="'someChannel'" send-timeout="123"/>
|
||||
|
||||
<filter id="filter" input-channel="filterInput" expression="'true'" send-timeout="123"/>
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
<recipient channel="channel1"/>
|
||||
<recipient channel="channel2"/>
|
||||
</recipient-list-router>
|
||||
|
||||
|
||||
<recipient-list-router id="customRouter" input-channel="routingChannelB"
|
||||
timeout="1234"
|
||||
send-timeout="1234"
|
||||
ignore-send-failures="true"
|
||||
apply-sequence="true">
|
||||
<recipient channel="channel1"/>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
<channel id="timeoutRouterChannel"/>
|
||||
|
||||
<router id="routerWithTimeout" ref="payloadAsChannelNameRouter" timeout="1234" input-channel="timeoutRouterChannel"/>
|
||||
<router id="routerWithTimeout" ref="payloadAsChannelNameRouter" send-timeout="1234" input-channel="timeoutRouterChannel"/>
|
||||
|
||||
<router input-channel="routerNestedBeanChannel" method="route">
|
||||
<beans:bean class="org.springframework.integration.router.config.TestRouter"/>
|
||||
|
||||
@@ -105,12 +105,6 @@ public class MessageStoreTests {
|
||||
return removed ? new SimpleMessageGroup(correlationKey) : testMessages;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public MessageGroup removeMessageFromGroup(Object key, Message<?> messageToRemove) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMessagesFromGroup(Object key, Collection<Message<?>> messages) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
Reference in New Issue
Block a user