Coverage Report - org.mule.config.spring.factories.CompositeMessageSourceFactoryBean
 
Classes in this File Line Coverage Branch Coverage Complexity
CompositeMessageSourceFactoryBean
0%
0/10
0%
0/2
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.config.spring.factories;
 8  
 
 9  
 import org.mule.api.processor.MessageProcessor;
 10  
 import org.mule.api.source.CompositeMessageSource;
 11  
 import org.mule.api.source.MessageSource;
 12  
 import org.mule.source.StartableCompositeMessageSource;
 13  
 
 14  
 import java.util.Collections;
 15  
 import java.util.List;
 16  
 
 17  
 import org.springframework.beans.factory.FactoryBean;
 18  
 
 19  0
 public class CompositeMessageSourceFactoryBean implements FactoryBean
 20  
 {
 21  
 
 22  0
     protected List<MessageSource> sources = Collections.<MessageSource> emptyList();
 23  
 
 24  
     public Class getObjectType()
 25  
     {
 26  0
         return MessageProcessor.class;
 27  
     }
 28  
 
 29  
     public void setMessageSources(List<MessageSource> sources)
 30  
     {
 31  0
         this.sources = sources;
 32  0
     }
 33  
 
 34  
     public Object getObject() throws Exception
 35  
     {
 36  0
         CompositeMessageSource composite = new StartableCompositeMessageSource();
 37  0
         for (MessageSource source : sources)
 38  
         {
 39  0
             composite.addSource(source);
 40  
         }
 41  0
         return composite;
 42  
     }
 43  
 
 44  
     public boolean isSingleton()
 45  
     {
 46  0
         return false;
 47  
     }
 48  
 
 49  
 }