master
Juergen Hoeller 7 years ago
parent 33cd160861
commit a19d4deb24
  1. 4
      spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java
  2. 6
      spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java
  3. 13
      spring-jms/src/main/java/org/springframework/jms/support/JmsHeaderMapper.java
  4. 9
      spring-jms/src/main/java/org/springframework/jms/support/SimpleJmsHeaderMapper.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -45,6 +45,7 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
this.aspectClass = aspectClass; this.aspectClass = aspectClass;
} }
/** /**
* Return the specified aspect class (never {@code null}). * Return the specified aspect class (never {@code null}).
*/ */
@ -52,7 +53,6 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
return this.aspectClass; return this.aspectClass;
} }
@Override @Override
public final Object getAspectInstance() { public final Object getAspectInstance() {
try { try {

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -524,10 +524,10 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
Closure callable = (Closure) args[args.length - 1]; Closure callable = (Closure) args[args.length - 1];
callable.setDelegate(this); callable.setDelegate(this);
callable.setResolveStrategy(Closure.DELEGATE_FIRST); callable.setResolveStrategy(Closure.DELEGATE_FIRST);
callable.call(currentBeanDefinition); callable.call(this.currentBeanDefinition);
} }
GroovyBeanDefinitionWrapper beanDefinition = currentBeanDefinition; GroovyBeanDefinitionWrapper beanDefinition = this.currentBeanDefinition;
this.currentBeanDefinition = null; this.currentBeanDefinition = null;
beanDefinition.getBeanDefinition().setAttribute(GroovyBeanDefinitionWrapper.class.getName(), beanDefinition); beanDefinition.getBeanDefinition().setAttribute(GroovyBeanDefinitionWrapper.class.getName(), beanDefinition);
getRegistry().registerBeanDefinition(beanName, beanDefinition.getBeanDefinition()); getRegistry().registerBeanDefinition(beanName, beanDefinition.getBeanDefinition());

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -21,9 +21,9 @@ import javax.jms.Message;
import org.springframework.messaging.support.HeaderMapper; import org.springframework.messaging.support.HeaderMapper;
/** /**
* Strategy interface for mapping messaging Message headers to an outbound * Strategy interface for mapping {@link org.springframework.messaging.Message}
* JMS Message (e.g. to configure JMS properties) or extracting messaging * headers to an outbound JMS {@link javax.jms.Message} (e.g. to configure JMS
* header values from an inbound JMS Message. * properties) or extracting messaging header values from an inbound JMS Message.
* *
* @author Mark Fisher * @author Mark Fisher
* @author Oleg Zhurakousky * @author Oleg Zhurakousky
@ -32,7 +32,10 @@ import org.springframework.messaging.support.HeaderMapper;
*/ */
public interface JmsHeaderMapper extends HeaderMapper<Message> { public interface JmsHeaderMapper extends HeaderMapper<Message> {
static final String CONTENT_TYPE_PROPERTY = "content_type"; /**
* The JMS-compliant {@code content_type} property.
*/
String CONTENT_TYPE_PROPERTY = "content_type";
} }

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -205,7 +205,6 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
logger.info("Failed to read JMSTimestamp property - skipping", ex); logger.info("Failed to read JMSTimestamp property - skipping", ex);
} }
Enumeration<?> jmsPropertyNames = jmsMessage.getPropertyNames(); Enumeration<?> jmsPropertyNames = jmsMessage.getPropertyNames();
if (jmsPropertyNames != null) { if (jmsPropertyNames != null) {
while (jmsPropertyNames.hasMoreElements()) { while (jmsPropertyNames.hasMoreElements()) {
@ -233,7 +232,8 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
/** /**
* Add the outbound prefix if necessary. * Add the outbound prefix if necessary.
* <p>Convert {@link MessageHeaders#CONTENT_TYPE} to content_type for JMS compliance. * <p>Convert {@link MessageHeaders#CONTENT_TYPE} to {@code content_type} for JMS compliance.
* @see #CONTENT_TYPE_PROPERTY
*/ */
protected String fromHeaderName(String headerName) { protected String fromHeaderName(String headerName) {
if (MessageHeaders.CONTENT_TYPE.equals(headerName)) { if (MessageHeaders.CONTENT_TYPE.equals(headerName)) {
@ -244,7 +244,8 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
/** /**
* Add the inbound prefix if necessary. * Add the inbound prefix if necessary.
* <p>Convert content_type to {@link MessageHeaders#CONTENT_TYPE}. * <p>Convert the JMS-compliant {@code content_type} to {@link MessageHeaders#CONTENT_TYPE}.
* @see #CONTENT_TYPE_PROPERTY
*/ */
protected String toHeaderName(String propertyName) { protected String toHeaderName(String propertyName) {
if (CONTENT_TYPE_PROPERTY.equals(propertyName)) { if (CONTENT_TYPE_PROPERTY.equals(propertyName)) {

Loading…
Cancel
Save