1 20 package org.apache.mina.common.support; 21 22 import org.apache.mina.common.IoConnectorConfig; 23 24 30 public abstract class BaseIoConnectorConfig extends BaseIoServiceConfig 31 implements IoConnectorConfig { 32 private int connectTimeout = 60; 34 protected BaseIoConnectorConfig() { 35 super(); 36 } 37 38 public int getConnectTimeout() { 39 return connectTimeout; 40 } 41 42 public long getConnectTimeoutMillis() { 43 return connectTimeout * 1000L; 44 } 45 46 public void setConnectTimeout(int connectTimeout) { 47 if (connectTimeout <= 0) { 48 throw new IllegalArgumentException ("connectTimeout: " 49 + connectTimeout); 50 } 51 this.connectTimeout = connectTimeout; 52 } 53 } 54 | Popular Tags |