Calling afterPropertiesSet() in post-processor if an endpoint was created.

This commit is contained in:
Mark Fisher
2008-09-05 21:23:37 +00:00
parent e75fbeef76
commit bbd28e9817
2 changed files with 7 additions and 6 deletions

View File

@@ -271,25 +271,25 @@ public class DefaultMessageBus implements MessageBus, ApplicationContextAware, A
if (source == null) {
throw new ConfigurationException("endpoint '" + endpoint + "' has no source");
}
if (source != null && source instanceof SubscribableSource) {
if (source instanceof SubscribableSource) {
((SubscribableSource) source).subscribe(endpoint);
if (source instanceof PollingDispatcher) {
PollingDispatcher poller = (PollingDispatcher) source;
this.pollingDispatchers.add(poller);
this.taskScheduler.schedule(poller);
}
if (logger.isInfoEnabled()) {
logger.info("activated subscription to channel '"
+ source + "' for endpoint '" + endpoint + "'");
}
return;
}
if (source != null && source instanceof PollableSource) {
else if (source instanceof PollableSource) {
PollingDispatcher poller = new PollingDispatcher((PollableSource<?>) source, this.defaultPollerSchedule);
poller.subscribe(endpoint);
this.pollingDispatchers.add(poller);
this.taskScheduler.schedule(poller);
}
if (logger.isInfoEnabled()) {
logger.info("activated subscription to channel '"
+ source + "' for endpoint '" + endpoint + "'");
}
}
private void registerGateway(String name, MessagingGateway gateway) {

View File

@@ -69,6 +69,7 @@ public abstract class AbstractMethodAnnotationPostProcessor<T extends Annotation
if (endpoint.getName() == null) {
endpoint.setBeanName(this.generateEndpointName(beanName, annotation));
}
endpoint.afterPropertiesSet();
return endpoint;
}
}