|
54 | 54 | import org.springframework.integration.channel.DirectChannel; |
55 | 55 | import org.springframework.integration.channel.MessagePublishingErrorHandler; |
56 | 56 | import org.springframework.integration.config.IntegrationConfigUtils; |
| 57 | +import org.springframework.integration.context.IntegrationObjectSupport; |
57 | 58 | import org.springframework.integration.context.Orderable; |
58 | 59 | import org.springframework.integration.endpoint.AbstractEndpoint; |
59 | 60 | import org.springframework.integration.endpoint.AbstractPollingEndpoint; |
@@ -164,6 +165,11 @@ public Object postProcess(Object bean, String beanName, Method method, List<Anno |
164 | 165 | && StringUtils.hasText(MessagingAnnotationUtils.endpointIdValue(method))) { |
165 | 166 | handlerBeanName = handlerBeanName + ".wrapper"; |
166 | 167 | } |
| 168 | + if (handler instanceof IntegrationObjectSupport) { |
| 169 | + ((IntegrationObjectSupport) handler).setComponentName( |
| 170 | + handlerBeanName.substring(0, |
| 171 | + handlerBeanName.indexOf(IntegrationConfigUtils.HANDLER_ALIAS_SUFFIX))); |
| 172 | + } |
167 | 173 | this.beanFactory.registerSingleton(handlerBeanName, handler); |
168 | 174 | handler = (MessageHandler) this.beanFactory.initializeBean(handler, handlerBeanName); |
169 | 175 | if (handler instanceof DisposableBean && this.disposables != null) { |
@@ -396,11 +402,11 @@ protected void configurePollingEndpoint(AbstractPollingEndpoint pollingEndpoint, |
396 | 402 |
|
397 | 403 | if (StringUtils.hasText(ref)) { |
398 | 404 | Assert.state(!StringUtils.hasText(triggerRef) |
399 | | - && !StringUtils.hasText(executorRef) |
400 | | - && !StringUtils.hasText(cron) |
401 | | - && !StringUtils.hasText(fixedDelayValue) |
402 | | - && !StringUtils.hasText(fixedRateValue) |
403 | | - && !StringUtils.hasText(maxMessagesPerPollValue), // NOSONAR boolean complexity |
| 405 | + && !StringUtils.hasText(executorRef) |
| 406 | + && !StringUtils.hasText(cron) |
| 407 | + && !StringUtils.hasText(fixedDelayValue) |
| 408 | + && !StringUtils.hasText(fixedRateValue) |
| 409 | + && !StringUtils.hasText(maxMessagesPerPollValue), // NOSONAR boolean complexity |
404 | 410 | "The '@Poller' 'ref' attribute is mutually exclusive with other attributes."); |
405 | 411 | pollerMetadata = this.beanFactory.getBean(ref, PollerMetadata.class); |
406 | 412 | } |
|
0 commit comments