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 defaultChannelBufferFactory
used to create a newChannelBuffer
.int
Returns the connect timeout of the channel in milliseconds.Returns theChannelPipelineFactory
which will be used when a child channel is created.void
setBufferFactory
(ChannelBufferFactory bufferFactory) Sets the defaultChannelBufferFactory
used to create a newChannelBuffer
.void
setConnectTimeoutMillis
(int connectTimeoutMillis) Sets the connect timeout of the channel in milliseconds.boolean
Sets a configuration property with the specified name and value.void
setOptions
(Map<String, Object> options) Sets the configuration properties from the specifiedMap
.void
setPipelineFactory
(ChannelPipelineFactory pipelineFactory) Sets theChannelPipelineFactory
which 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:ChannelConfig
Sets the configuration properties from the specifiedMap
.- Specified by:
setOptions
in interfaceChannelConfig
-
setOption
Description copied from interface:ChannelConfig
Sets 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:
setOption
in interfaceChannelConfig
- Returns:
true
if and only if the property has been set
-
getConnectTimeoutMillis
public int getConnectTimeoutMillis()Description copied from interface:ChannelConfig
Returns the connect timeout of the channel in milliseconds. If theChannel
does not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
getConnectTimeoutMillis
in interfaceChannelConfig
- Returns:
- the connect timeout in milliseconds.
0
if disabled.
-
getBufferFactory
Description copied from interface:ChannelConfig
Returns the defaultChannelBufferFactory
used to create a newChannelBuffer
. The default isHeapChannelBufferFactory
. You can specify a different factory to change the defaultByteOrder
for example.- Specified by:
getBufferFactory
in interfaceChannelConfig
-
setBufferFactory
Description copied from interface:ChannelConfig
Sets the defaultChannelBufferFactory
used to create a newChannelBuffer
. The default isHeapChannelBufferFactory
. You can specify a different factory to change the defaultByteOrder
for example.- Specified by:
setBufferFactory
in interfaceChannelConfig
-
getPipelineFactory
Description copied from interface:ChannelConfig
Returns theChannelPipelineFactory
which will be used when a child channel is created. If theChannel
does not create a child channel, this property is not used at all, and therefore will be ignored.- Specified by:
getPipelineFactory
in interfaceChannelConfig
-
setConnectTimeoutMillis
public void setConnectTimeoutMillis(int connectTimeoutMillis) Description copied from interface:ChannelConfig
Sets the connect timeout of the channel in milliseconds. If theChannel
does not support connect operation, this property is not used at all, and therefore will be ignored.- Specified by:
setConnectTimeoutMillis
in interfaceChannelConfig
- Parameters:
connectTimeoutMillis
- the connect timeout in milliseconds.0
to disable.
-
setPipelineFactory
Description copied from interface:ChannelConfig
Sets theChannelPipelineFactory
which will be used when a child channel is created. If theChannel
does not create a child channel, this property is not used at all, and therefore will be ignored.- Specified by:
setPipelineFactory
in interfaceChannelConfig
-