@Override
 protected void doStop() {
   if (this.source instanceof Lifecycle) {
     ((Lifecycle) this.source).stop();
   }
   super.doStop();
 }
 @Override
 protected void onInit() {
   Assert.notNull(this.source, "source must not be null");
   Assert.state(
       (this.outputChannelName == null && this.outputChannel != null)
           || (this.outputChannelName != null && this.outputChannel == null),
       "One and only one of 'outputChannelName' or 'outputChannel' is required.");
   super.onInit();
   if (this.getBeanFactory() != null) {
     this.messagingTemplate.setBeanFactory(this.getBeanFactory());
   }
 }