View Javadoc

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