public class DefaultChannelConfig extends Object implements ChannelConfig
SocketChannelConfig implementation.| Constructor and Description |
|---|
DefaultChannelConfig() |
| Modifier and Type | Method and Description |
|---|---|
int |
getConnectTimeoutMillis()
Returns the connect timeout of the channel in milliseconds.
|
<T> T |
getOption(ChannelOption<T> option)
Return the value of the given
ChannelOption |
Map<ChannelOption<?>,Object> |
getOptions()
Return all set
ChannelOption's. |
protected Map<ChannelOption<?>,Object> |
getOptions(Map<ChannelOption<?>,Object> result,
ChannelOption<?>... options) |
int |
getWriteSpinCount()
Returns the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value. |
void |
setConnectTimeoutMillis(int connectTimeoutMillis)
Sets the connect timeout of the channel in milliseconds.
|
<T> boolean |
setOption(ChannelOption<T> option,
T value)
Sets a configuration property with the specified name and value.
|
boolean |
setOptions(Map<ChannelOption<?>,?> options)
Sets the configuration properties from the specified
Map. |
void |
setWriteSpinCount(int writeSpinCount)
Sets the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value. |
protected <T> void |
validate(ChannelOption<T> option,
T value) |
public Map<ChannelOption<?>,Object> getOptions()
ChannelConfigChannelOption's.getOptions in interface ChannelConfigprotected Map<ChannelOption<?>,Object> getOptions(Map<ChannelOption<?>,Object> result, ChannelOption<?>... options)
public boolean setOptions(Map<ChannelOption<?>,?> options)
ChannelConfigMap.setOptions in interface ChannelConfigpublic <T> T getOption(ChannelOption<T> option)
ChannelConfigChannelOptiongetOption in interface ChannelConfigpublic <T> boolean setOption(ChannelOption<T> option, T value)
ChannelConfig
public boolean setOption(String name, Object value) {
if (super.setOption(name, value)) {
return true;
}
if (name.equals("additionalOption")) {
....
return true;
}
return false;
}
setOption in interface ChannelConfigtrue if and only if the property has been setprotected <T> void validate(ChannelOption<T> option, T value)
public int getConnectTimeoutMillis()
ChannelConfigChannel does not support connect operation, this property is not
used at all, and therefore will be ignored.getConnectTimeoutMillis in interface ChannelConfig0 if disabled.public void setConnectTimeoutMillis(int connectTimeoutMillis)
ChannelConfigChannel does not support connect operation, this property is not
used at all, and therefore will be ignored.setConnectTimeoutMillis in interface ChannelConfigconnectTimeoutMillis - the connect timeout in milliseconds.
0 to disable.public int getWriteSpinCount()
ChannelConfigWritableByteChannel.write(ByteBuffer) returns a non-zero value.
It is similar to what a spin lock is used for in concurrency programming.
It improves memory utilization and write throughput depending on
the platform that JVM runs on. The default value is 16.getWriteSpinCount in interface ChannelConfigpublic void setWriteSpinCount(int writeSpinCount)
ChannelConfigWritableByteChannel.write(ByteBuffer) returns a non-zero value.
It is similar to what a spin lock is used for in concurrency programming.
It improves memory utilization and write throughput depending on
the platform that JVM runs on. The default value is 16.setWriteSpinCount in interface ChannelConfigCopyright © 2008-2012 The Netty Project. All Rights Reserved.