List of usage examples for org.apache.http.impl.nio.reactor IOReactorConfig.Builder setSelectInterval
@Deprecated public void setSelectInterval(final long selectInterval)
From source file:org.wso2.carbon.inbound.endpoint.protocol.hl7.core.InboundHL7IOReactor.java
private static IOReactorConfig getDefaultReactorConfig() { IOReactorConfig.Builder builder = IOReactorConfig.custom(); return builder .setSelectInterval(HL7Configuration.getInstance() .getIntProperty(MLLPConstants.TCPConstants.SELECT_INTERVAL, 1000)) .setShutdownGracePeriod(HL7Configuration.getInstance() .getIntProperty(MLLPConstants.TCPConstants.SHUTDOWN_GRACE_PERIOD, 500)) .setIoThreadCount(HL7Configuration.getInstance().getIntProperty( MLLPConstants.TCPConstants.IO_THREAD_COUNT, Runtime.getRuntime().availableProcessors())) .setSoTimeout(/*from w w w . j a va2 s .co m*/ HL7Configuration.getInstance().getIntProperty(MLLPConstants.TCPConstants.SO_TIMEOUT, 0)) .setSoKeepAlive(HL7Configuration.getInstance() .getBooleanProperty(MLLPConstants.TCPConstants.SO_KEEP_ALIVE, true)) .setTcpNoDelay(HL7Configuration.getInstance() .getBooleanProperty(MLLPConstants.TCPConstants.TCP_NO_DELAY, true)) .setConnectTimeout(HL7Configuration.getInstance() .getIntProperty(MLLPConstants.TCPConstants.CONNECT_TIMEOUT, 0)) .setRcvBufSize( HL7Configuration.getInstance().getIntProperty(MLLPConstants.TCPConstants.SO_RCVBUF, 0)) .setSndBufSize( HL7Configuration.getInstance().getIntProperty(MLLPConstants.TCPConstants.SO_SNDBUF, 0)) .setInterestOpQueued(false).setSoReuseAddress(true).setSoLinger(-1).build(); }
From source file:org.apache.synapse.transport.utils.config.HttpTransportConfiguration.java
/** * Get the listening I/O reactor configuration * * @return A fully initialized IOReactorConfig instance */// w ww . j av a 2 s .com public IOReactorConfig getListeningReactorConfig() { IOReactorConfig.Builder builder = IOReactorConfig.custom().setIoThreadCount(getThreadsPerReactor()) .setSoTimeout(getIntProperty(HttpConfigConstants.LISTENER_SO_TIMEOUT, getIntProperty(HttpConfigConstants.SO_TIMEOUT, 60000))) .setConnectTimeout(getIntProperty(HttpConfigConstants.CONNECTION_TIMEOUT, 0)) .setInterestOpQueued(getBooleanProperty(HttpConfigConstants.INTEREST_OPS_QUEUEING, false)) .setTcpNoDelay(getBooleanProperty(HttpConfigConstants.TCP_NODELAY, true)); if (getIntProperty(HttpConfigConstants.SOCKET_RCV_BUFFER_SIZE) != null) { builder.setRcvBufSize(getIntProperty(HttpConfigConstants.SOCKET_RCV_BUFFER_SIZE)); } if (getIntProperty(HttpConfigConstants.SOCKET_SND_BUFFER_SIZE) != null) { builder.setSndBufSize(getIntProperty(HttpConfigConstants.SOCKET_SND_BUFFER_SIZE)); } if (getIntProperty(HttpConfigConstants.SO_LINGER) != null) { builder.setSoLinger(getIntProperty(HttpConfigConstants.SO_LINGER)); } if (getBooleanProperty(HttpConfigConstants.SO_REUSEADDR) != null) { builder.setSoReuseAddress(getBooleanProperty(HttpConfigConstants.SO_REUSEADDR)); } if (getIntProperty(HttpConfigConstants.SELECT_INTERVAL) != null) { builder.setSelectInterval(getIntProperty(HttpConfigConstants.SELECT_INTERVAL)); } return builder.build(); }
From source file:org.apache.synapse.transport.utils.config.HttpTransportConfiguration.java
/** * Get the connecting I/O reactor configuration * * @return A fully initialized IOReactorConfig instance *//*www. ja v a 2s . c om*/ public IOReactorConfig getConnectingReactorConfig() { IOReactorConfig.Builder builder = IOReactorConfig.custom().setIoThreadCount(getThreadsPerReactor()) .setSoTimeout(getIntProperty(HttpConfigConstants.SENDER_SO_TIMEOUT, getIntProperty(HttpConfigConstants.SO_TIMEOUT, 60000))) .setConnectTimeout(getIntProperty(HttpConfigConstants.CONNECTION_TIMEOUT, 0)) .setInterestOpQueued(getBooleanProperty(HttpConfigConstants.INTEREST_OPS_QUEUEING, false)) .setTcpNoDelay(getBooleanProperty(HttpConfigConstants.TCP_NODELAY, true)); if (getIntProperty(HttpConfigConstants.SOCKET_RCV_BUFFER_SIZE) != null) { builder.setRcvBufSize(getIntProperty(HttpConfigConstants.SOCKET_RCV_BUFFER_SIZE)); } if (getIntProperty(HttpConfigConstants.SOCKET_SND_BUFFER_SIZE) != null) { builder.setSndBufSize(getIntProperty(HttpConfigConstants.SOCKET_SND_BUFFER_SIZE)); } if (getIntProperty(HttpConfigConstants.SO_LINGER) != null) { builder.setSoLinger(getIntProperty(HttpConfigConstants.SO_LINGER)); } if (getBooleanProperty(HttpConfigConstants.SO_REUSEADDR) != null) { builder.setSoReuseAddress(getBooleanProperty(HttpConfigConstants.SO_REUSEADDR)); } if (getIntProperty(HttpConfigConstants.SELECT_INTERVAL) != null) { builder.setSelectInterval(getIntProperty(HttpConfigConstants.SELECT_INTERVAL)); } return builder.build(); }