@@ -226,10 +226,19 @@ public Set<JmsListener> inspect(Method method) {
226
226
return bean ;
227
227
}
228
228
229
+ /**
230
+ * Process the given {@link JmsListener} annotation on the given method,
231
+ * registering a corresponding endpoint for the given bean instance.
232
+ * @param jmsListener the annotation to process
233
+ * @param mostSpecificMethod the annotated method
234
+ * @param bean the instance to invoke the method on
235
+ * @see #createMethodJmsListenerEndpoint()
236
+ * @see JmsListenerEndpointRegistrar#registerEndpoint
237
+ */
229
238
protected void processJmsListener (JmsListener jmsListener , Method mostSpecificMethod , Object bean ) {
230
239
Method invocableMethod = MethodIntrospector .selectInvocableMethod (mostSpecificMethod , bean .getClass ());
231
240
232
- MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint ();
241
+ MethodJmsListenerEndpoint endpoint = createMethodJmsListenerEndpoint ();
233
242
endpoint .setBean (bean );
234
243
endpoint .setMethod (invocableMethod );
235
244
endpoint .setMostSpecificMethod (mostSpecificMethod );
@@ -264,6 +273,17 @@ protected void processJmsListener(JmsListener jmsListener, Method mostSpecificMe
264
273
this .registrar .registerEndpoint (endpoint , factory );
265
274
}
266
275
276
+ /**
277
+ * Instantiate an empty {@link MethodJmsListenerEndpoint} for further
278
+ * configuration with provided parameters in {@link #processJmsListener}.
279
+ * @return a new {@code MethodJmsListenerEndpoint} or subclass thereof
280
+ * @since 4.1.9
281
+ * @see MethodJmsListenerEndpoint#createMessageListenerInstance()
282
+ */
283
+ protected MethodJmsListenerEndpoint createMethodJmsListenerEndpoint () {
284
+ return new MethodJmsListenerEndpoint ();
285
+ }
286
+
267
287
private String getEndpointId (JmsListener jmsListener ) {
268
288
if (StringUtils .hasText (jmsListener .id ())) {
269
289
return resolve (jmsListener .id ());
0 commit comments