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