View Javadoc
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.transport.tcp;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.api.config.MuleProperties;
11  
12  import java.util.Properties;
13  
14  /**
15   * <code>PollingTcpMessageReceiver</code> acts as a polling TCP connector.
16   * 
17   * @author esteban.robles
18   */
19  public class PollingTcpConnector extends TcpConnector
20  {
21      /**
22       * How long to wait in milliseconds between make a new request
23       */
24      private long pollingFrequency = 1000L;
25  
26      public PollingTcpConnector(MuleContext context)
27      {
28      	super(context);
29          serviceOverrides = new Properties();
30          serviceOverrides.setProperty(MuleProperties.CONNECTOR_MESSAGE_RECEIVER_CLASS,
31              PollingTcpMessageReceiver.class.getName());
32      }
33  
34      public long getPollingFrequency()
35      {
36          return pollingFrequency;
37      }
38  
39      public void setPollingFrequency(long pollingFrequency)
40      {
41          this.pollingFrequency = pollingFrequency;
42      }
43  }