private void registerSources() {
   for (SimpleMessageSourceMetrics source : sources) {
     MessageSourceMetrics monitor = enhanceSourceMonitor(source);
     String name = monitor.getName();
     this.allSourcesByName.put(name, monitor);
     if (!PatternMatchUtils.simpleMatch(this.componentNamePatterns, name)) {
       continue;
     }
     // Only register once...
     if (!sourcesByName.containsKey(name)) {
       String beanKey = getSourceBeanKey(monitor);
       if (name != null) {
         sourcesByName.put(name, monitor);
       }
       registerBeanNameOrInstance(monitor, beanKey);
       // Expose the raw bean if it is managed
       MessageSource<?> bean = source.getMessageSource();
       if (assembler.includeBean(bean.getClass(), source.getName())) {
         registerBeanInstance(bean, this.getMonitoredIntegrationObjectBeanKey(bean, name));
       }
     }
   }
 }
 private void registerChannels() {
   for (DirectChannelMetrics monitor : channels) {
     String name = monitor.getName();
     this.allChannelsByName.put(name, monitor);
     if (!PatternMatchUtils.simpleMatch(this.componentNamePatterns, name)) {
       continue;
     }
     // Only register once...
     if (!channelsByName.containsKey(name)) {
       String beanKey = getChannelBeanKey(name);
       logger.info("Registering MessageChannel " + name);
       if (name != null) {
         channelsByName.put(name, monitor);
       }
       registerBeanNameOrInstance(monitor, beanKey);
       // Expose the raw bean if it is managed
       MessageChannel bean = monitor.getMessageChannel();
       if (assembler.includeBean(bean.getClass(), monitor.getName())) {
         registerBeanInstance(bean, this.getMonitoredIntegrationObjectBeanKey(bean, name));
       }
     }
   }
 }