* Made ChannelConfig.setOption() public
This commit is contained in:
parent
988fff225f
commit
13c68c7643
@ -78,6 +78,28 @@ public interface ChannelConfig {
|
|||||||
*/
|
*/
|
||||||
void setOptions(Map<String, Object> options);
|
void setOptions(Map<String, Object> options);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a configuration property with the specified name and value.
|
||||||
|
* To override this method properly, you must call the super class:
|
||||||
|
* <pre>
|
||||||
|
* public boolean setOption(String name, Object value) {
|
||||||
|
* if (super.setOption(name, value)) {
|
||||||
|
* return true;
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* if (name.equals("additionalOption")) {
|
||||||
|
* ....
|
||||||
|
* return true;
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* return false;
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @return {@code true} if and only if the property has been set
|
||||||
|
*/
|
||||||
|
boolean setOption(String name, Object value);
|
||||||
|
|
||||||
ChannelBufferFactory getBufferFactory();
|
ChannelBufferFactory getBufferFactory();
|
||||||
|
|
||||||
void setBufferFactory(ChannelBufferFactory bufferFactory);
|
void setBufferFactory(ChannelBufferFactory bufferFactory);
|
||||||
|
@ -56,11 +56,7 @@ public class DefaultChannelConfig implements ChannelConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public boolean setOption(String key, Object value) {
|
||||||
* Sets an individual option. You can override this method to support
|
|
||||||
* additional configuration parameters.
|
|
||||||
*/
|
|
||||||
protected boolean setOption(String key, Object value) {
|
|
||||||
if (key.equals("pipelineFactory")) {
|
if (key.equals("pipelineFactory")) {
|
||||||
setPipelineFactory((ChannelPipelineFactory) value);
|
setPipelineFactory((ChannelPipelineFactory) value);
|
||||||
} else if (key.equals("bufferFactory")) {
|
} else if (key.equals("bufferFactory")) {
|
||||||
|
@ -59,7 +59,7 @@ public class DefaultServerChannelConfig implements ChannelConfig {
|
|||||||
* Sets an individual option. You can override this method to support
|
* Sets an individual option. You can override this method to support
|
||||||
* additional configuration parameters.
|
* additional configuration parameters.
|
||||||
*/
|
*/
|
||||||
protected boolean setOption(String key, Object value) {
|
public boolean setOption(String key, Object value) {
|
||||||
if (key.equals("pipelineFactory")) {
|
if (key.equals("pipelineFactory")) {
|
||||||
setPipelineFactory((ChannelPipelineFactory) value);
|
setPipelineFactory((ChannelPipelineFactory) value);
|
||||||
} else if (key.equals("bufferFactory")) {
|
} else if (key.equals("bufferFactory")) {
|
||||||
|
@ -54,7 +54,7 @@ public class DefaultServerSocketChannelConfig extends DefaultServerChannelConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean setOption(String key, Object value) {
|
public boolean setOption(String key, Object value) {
|
||||||
if (super.setOption(key, value)) {
|
if (super.setOption(key, value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class DefaultSocketChannelConfig extends DefaultChannelConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean setOption(String key, Object value) {
|
public boolean setOption(String key, Object value) {
|
||||||
if (super.setOption(key, value)) {
|
if (super.setOption(key, value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ final class HttpTunnelingSocketChannelConfig extends DefaultChannelConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean setOption(String key, Object value) {
|
public boolean setOption(String key, Object value) {
|
||||||
if (key.equals("receiveBufferSize")) {
|
if (key.equals("receiveBufferSize")) {
|
||||||
setReceiveBufferSize(ConversionUtil.toInt(value));
|
setReceiveBufferSize(ConversionUtil.toInt(value));
|
||||||
} else if (key.equals("sendBufferSize")) {
|
} else if (key.equals("sendBufferSize")) {
|
||||||
|
@ -72,7 +72,7 @@ class DefaultNioSocketChannelConfig extends DefaultSocketChannelConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean setOption(String key, Object value) {
|
public boolean setOption(String key, Object value) {
|
||||||
if (super.setOption(key, value)) {
|
if (super.setOption(key, value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user