Package org.jboss.netty.channel
Class DefaultChannelConfig
java.lang.Object
org.jboss.netty.channel.DefaultChannelConfig
- All Implemented Interfaces:
ChannelConfig
- Direct Known Subclasses:
DefaultDatagramChannelConfig,DefaultSocketChannelConfig
The default
SocketChannelConfig implementation.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the defaultChannelBufferFactoryused to create a newChannelBuffer.intReturns the connect timeout of the channel in milliseconds.Returns theChannelPipelineFactorywhich will be used when a child channel is created.voidsetBufferFactory(ChannelBufferFactory bufferFactory) Sets the defaultChannelBufferFactoryused to create a newChannelBuffer.voidsetConnectTimeoutMillis(int connectTimeoutMillis) Sets the connect timeout of the channel in milliseconds.booleanSets a configuration property with the specified name and value.voidsetOptions(Map<String, Object> options) Sets the configuration properties from the specifiedMap.voidsetPipelineFactory(ChannelPipelineFactory pipelineFactory) Sets theChannelPipelineFactorywhich will be used when a child channel is created.
-
Field Details
-
bufferFactory
-
connectTimeoutMillis
private volatile int connectTimeoutMillis
-
-
Constructor Details
-
DefaultChannelConfig
public DefaultChannelConfig()
-
-
Method Details
-
setOptions
Description copied from interface:ChannelConfigSets the configuration properties from the specifiedMap.- Specified by:
setOptionsin interfaceChannelConfig
-
setOption
Description copied from interface:ChannelConfigSets a configuration property with the specified name and value. To override this method properly, you must call the super class:public boolean setOption(String name, Object value) { if (super.setOption(name, value)) { return true; } if (name.equals("additionalOption")) { .... return true; } return false; }- Specified by:
setOptionin interfaceChannelConfig- Returns:
trueif and only if the property has been set
-
getConnectTimeoutMillis
public int getConnectTimeoutMillis()Description copied from interface:ChannelConfigReturns the connect timeout of the channel in milliseconds. If theChanneldoes not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
getConnectTimeoutMillisin interfaceChannelConfig- Returns:
- the connect timeout in milliseconds.
0if disabled.
-
getBufferFactory
Description copied from interface:ChannelConfigReturns the defaultChannelBufferFactoryused to create a newChannelBuffer. The default isHeapChannelBufferFactory. You can specify a different factory to change the defaultByteOrderfor example.- Specified by:
getBufferFactoryin interfaceChannelConfig
-
setBufferFactory
Description copied from interface:ChannelConfigSets the defaultChannelBufferFactoryused to create a newChannelBuffer. The default isHeapChannelBufferFactory. You can specify a different factory to change the defaultByteOrderfor example.- Specified by:
setBufferFactoryin interfaceChannelConfig
-
getPipelineFactory
Description copied from interface:ChannelConfigReturns theChannelPipelineFactorywhich will be used when a child channel is created. If theChanneldoes not create a child channel, this property is not used at all, and therefore will be ignored.- Specified by:
getPipelineFactoryin interfaceChannelConfig
-
setConnectTimeoutMillis
public void setConnectTimeoutMillis(int connectTimeoutMillis) Description copied from interface:ChannelConfigSets the connect timeout of the channel in milliseconds. If theChanneldoes not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
setConnectTimeoutMillisin interfaceChannelConfig- Parameters:
connectTimeoutMillis- the connect timeout in milliseconds.0to disable.
-
setPipelineFactory
Description copied from interface:ChannelConfigSets theChannelPipelineFactorywhich will be used when a child channel is created. If theChanneldoes not create a child channel, this property is not used at all, and therefore will be ignored.- Specified by:
setPipelineFactoryin interfaceChannelConfig
-