@@ -226,10 +226,19 @@ public Set<JmsListener> inspect(Method method) {
226226 return bean ;
227227 }
228228
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+ */
229238 protected void processJmsListener (JmsListener jmsListener , Method mostSpecificMethod , Object bean ) {
230239 Method invocableMethod = MethodIntrospector .selectInvocableMethod (mostSpecificMethod , bean .getClass ());
231240
232- MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint ();
241+ MethodJmsListenerEndpoint endpoint = createMethodJmsListenerEndpoint ();
233242 endpoint .setBean (bean );
234243 endpoint .setMethod (invocableMethod );
235244 endpoint .setMostSpecificMethod (mostSpecificMethod );
@@ -264,6 +273,17 @@ protected void processJmsListener(JmsListener jmsListener, Method mostSpecificMe
264273 this .registrar .registerEndpoint (endpoint , factory );
265274 }
266275
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+
267287 private String getEndpointId (JmsListener jmsListener ) {
268288 if (StringUtils .hasText (jmsListener .id ())) {
269289 return resolve (jmsListener .id ());
0 commit comments