Coverage Report - org.mule.config.spring.factories.PollingMessageSourceFactoryBean
 
Classes in this File Line Coverage Branch Coverage Complexity
PollingMessageSourceFactoryBean
0%
0/12
0%
0/2
2
 
 1  
 /*
 2  
  * $Id: PollingMessageSourceFactoryBean.java 20395 2010-11-30 10:48:13Z dfeist $
 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.config.ConfigurationException;
 14  
 import org.mule.api.endpoint.EndpointFactory;
 15  
 import org.mule.api.processor.MessageProcessor;
 16  
 import org.mule.config.i18n.MessageFactory;
 17  
 import org.mule.endpoint.URIBuilder;
 18  
 import org.mule.transport.AbstractConnector;
 19  
 import org.mule.transport.polling.MessageProcessorPollingMessageReceiver;
 20  
 
 21  0
 public class PollingMessageSourceFactoryBean extends InboundEndpointFactoryBean
 22  
 {
 23  
 
 24  
     protected MessageProcessor messageProcessor;
 25  
     protected Long frequency;
 26  
 
 27  
     public Object doGetObject() throws Exception
 28  
     {
 29  0
         uriBuilder = new URIBuilder("polling://" + hashCode(), muleContext);
 30  0
         properties.put(MessageProcessorPollingMessageReceiver.SOURCE_MESSAGE_PROCESSOR_PROPERTY_NAME, messageProcessor);
 31  0
         properties.put(AbstractConnector.PROPERTY_POLLING_FREQUENCY, frequency);
 32  0
         EndpointFactory ef = muleContext.getRegistry().lookupEndpointFactory();
 33  0
         if (ef != null)
 34  
         {
 35  0
             return ef.getInboundEndpoint(this);
 36  
         }
 37  
         else
 38  
         {
 39  0
             throw new ConfigurationException(
 40  
                 MessageFactory.createStaticMessage("EndpointFactory not found in Registry"));
 41  
         }
 42  
     }
 43  
 
 44  
     public void setMessageProcessor(MessageProcessor messageProcessor)
 45  
     {
 46  0
         this.messageProcessor = messageProcessor;
 47  0
     }
 48  
 
 49  
     public void setFrequency(Long frequency)
 50  
     {
 51  0
         this.frequency = frequency;
 52  0
     }
 53  
 
 54  
 }