Skip to content

Commit 8c139ef

Browse files
committed
Polishing
1 parent ab478d1 commit 8c139ef

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

spring-jms/src/main/java/org/springframework/jms/annotation/JmsListenerAnnotationBeanPostProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ public Object postProcessAfterInitialization(final Object bean, String beanName)
205205
new MethodIntrospector.MetadataLookup<Set<JmsListener>>() {
206206
@Override
207207
public Set<JmsListener> inspect(Method method) {
208-
Set<JmsListener> listenerMethods =
209-
AnnotatedElementUtils.getMergedRepeatableAnnotations(method, JmsListener.class, JmsListeners.class);
208+
Set<JmsListener> listenerMethods = AnnotatedElementUtils.getMergedRepeatableAnnotations(
209+
method, JmsListener.class, JmsListeners.class);
210210
return (!listenerMethods.isEmpty() ? listenerMethods : null);
211211
}
212212
});

spring-jms/src/main/java/org/springframework/jms/config/JmsListenerEndpointRegistrar.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -136,7 +136,7 @@ protected void registerAllEndpoints() {
136136
this.endpointRegistry.registerListenerContainer(
137137
descriptor.endpoint, resolveContainerFactory(descriptor));
138138
}
139-
startImmediately = true; // trigger immediate startup
139+
this.startImmediately = true; // trigger immediate startup
140140
}
141141
}
142142

@@ -149,9 +149,10 @@ else if (this.containerFactory != null) {
149149
}
150150
else if (this.containerFactoryBeanName != null) {
151151
Assert.state(this.beanFactory != null, "BeanFactory must be set to obtain container factory by bean name");
152+
// Consider changing this if live change of the factory is required...
152153
this.containerFactory = this.beanFactory.getBean(
153154
this.containerFactoryBeanName, JmsListenerContainerFactory.class);
154-
return this.containerFactory; // Consider changing this if live change of the factory is required
155+
return this.containerFactory;
155156
}
156157
else {
157158
throw new IllegalStateException("Could not resolve the " +
@@ -169,10 +170,12 @@ else if (this.containerFactoryBeanName != null) {
169170
public void registerEndpoint(JmsListenerEndpoint endpoint, JmsListenerContainerFactory<?> factory) {
170171
Assert.notNull(endpoint, "Endpoint must be set");
171172
Assert.hasText(endpoint.getId(), "Endpoint id must be set");
173+
172174
// Factory may be null, we defer the resolution right before actually creating the container
173175
JmsListenerEndpointDescriptor descriptor = new JmsListenerEndpointDescriptor(endpoint, factory);
176+
174177
synchronized (this.mutex) {
175-
if (startImmediately) { // Register and start immediately
178+
if (this.startImmediately) { // register and start immediately
176179
this.endpointRegistry.registerListenerContainer(descriptor.endpoint,
177180
resolveContainerFactory(descriptor), true);
178181
}

0 commit comments

Comments
 (0)