Package org.jboss.netty.channel
Class DefaultChannelConfig
- java.lang.Object
-
- org.jboss.netty.channel.DefaultChannelConfig
-
- All Implemented Interfaces:
ChannelConfig
- Direct Known Subclasses:
DefaultDatagramChannelConfig,DefaultSocketChannelConfig
public class DefaultChannelConfig extends java.lang.Object implements ChannelConfig
The defaultSocketChannelConfigimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description private ChannelBufferFactorybufferFactoryprivate intconnectTimeoutMillis
-
Constructor Summary
Constructors Constructor Description DefaultChannelConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelBufferFactorygetBufferFactory()Returns the defaultChannelBufferFactoryused to create a newChannelBuffer.intgetConnectTimeoutMillis()Returns the connect timeout of the channel in milliseconds.ChannelPipelineFactorygetPipelineFactory()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.booleansetOption(java.lang.String key, java.lang.Object value)Sets a configuration property with the specified name and value.voidsetOptions(java.util.Map<java.lang.String,java.lang.Object> options)Sets the configuration properties from the specifiedMap.voidsetPipelineFactory(ChannelPipelineFactory pipelineFactory)Sets theChannelPipelineFactorywhich will be used when a child channel is created.
-
-
-
Field Detail
-
bufferFactory
private volatile ChannelBufferFactory bufferFactory
-
connectTimeoutMillis
private volatile int connectTimeoutMillis
-
-
Method Detail
-
setOptions
public void setOptions(java.util.Map<java.lang.String,java.lang.Object> options)
Description copied from interface:ChannelConfigSets the configuration properties from the specifiedMap.- Specified by:
setOptionsin interfaceChannelConfig
-
setOption
public boolean setOption(java.lang.String key, java.lang.Object value)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
public ChannelBufferFactory 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
public void setBufferFactory(ChannelBufferFactory bufferFactory)
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
public ChannelPipelineFactory 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
public void setPipelineFactory(ChannelPipelineFactory pipelineFactory)
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
-
-