@@ -209,7 +209,7 @@ public void doWith(Method method) throws IllegalArgumentException, IllegalAccess
209
209
if (annotatedMethods .isEmpty ()) {
210
210
this .nonAnnotatedClasses .add (bean .getClass ());
211
211
if (logger .isTraceEnabled ()) {
212
- logger .trace ("No @JmsListener annotations found on bean class : " + bean .getClass ());
212
+ logger .trace ("No @JmsListener annotations found on bean type : " + bean .getClass ());
213
213
}
214
214
}
215
215
else {
@@ -243,7 +243,7 @@ protected void processJmsListener(JmsListener jmsListener, Method method, Object
243
243
}
244
244
}
245
245
246
- MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint ();
246
+ MethodJmsListenerEndpoint endpoint = createMethodJmsListenerEndpoint ();
247
247
endpoint .setBean (bean );
248
248
endpoint .setMethod (method );
249
249
endpoint .setMessageHandlerMethodFactory (this .messageHandlerMethodFactory );
@@ -267,15 +267,26 @@ protected void processJmsListener(JmsListener jmsListener, Method method, Object
267
267
factory = this .beanFactory .getBean (containerFactoryBeanName , JmsListenerContainerFactory .class );
268
268
}
269
269
catch (NoSuchBeanDefinitionException ex ) {
270
- throw new BeanInitializationException ("Could not register jms listener endpoint on [" +
271
- method + "], no " + JmsListenerContainerFactory .class .getSimpleName () + " with id '" +
272
- containerFactoryBeanName + "' was found in the application context" , ex );
270
+ throw new BeanInitializationException ("Could not register JMS listener endpoint on [" +
271
+ method + "], no " + JmsListenerContainerFactory .class .getSimpleName () +
272
+ " with id '" + containerFactoryBeanName + "' was found in the application context" , ex );
273
273
}
274
274
}
275
275
276
276
this .registrar .registerEndpoint (endpoint , factory );
277
277
}
278
278
279
+ /**
280
+ * Instantiate an empty {@link MethodJmsListenerEndpoint} for further
281
+ * configuration with provided parameters in {@link #processJmsListener}.
282
+ * @return a new {@code MethodJmsListenerEndpoint} or subclass thereof
283
+ * @since 4.1.9
284
+ * @see MethodJmsListenerEndpoint#createMessageListenerInstance()
285
+ */
286
+ protected MethodJmsListenerEndpoint createMethodJmsListenerEndpoint () {
287
+ return new MethodJmsListenerEndpoint ();
288
+ }
289
+
279
290
private String getEndpointId (JmsListener jmsListener ) {
280
291
if (StringUtils .hasText (jmsListener .id ())) {
281
292
return resolve (jmsListener .id ());
0 commit comments