@Override public boolean setOption(String key, Object value) { if (super.setOption(key, value)) { return true; } if ("writeBufferHighWaterMark".equals(key)) { setWriteBufferHighWaterMark0(ConversionUtil.toInt(value)); } else if ("writeBufferLowWaterMark".equals(key)) { setWriteBufferLowWaterMark0(ConversionUtil.toInt(value)); } else if ("writeSpinCount".equals(key)) { setWriteSpinCount(ConversionUtil.toInt(value)); } else if ("receiveBufferSizePredictorFactory".equals(key)) { setReceiveBufferSizePredictorFactory((ReceiveBufferSizePredictorFactory) value); } else if ("receiveBufferSizePredictor".equals(key)) { setReceiveBufferSizePredictor((ReceiveBufferSizePredictor) value); } else { return false; } return true; }
public ReceiveBufferSizePredictor getReceiveBufferSizePredictor() { ReceiveBufferSizePredictor predictor = this.predictor; if (predictor == null) { try { this.predictor = predictor = getReceiveBufferSizePredictorFactory().getPredictor(); } catch (Exception e) { throw new ChannelException("Failed to create a new " + ReceiveBufferSizePredictor.class.getSimpleName() + '.', e); } } return predictor; }
public void setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor) { if (predictor == null) { throw new NullPointerException("predictor"); } this.predictor = predictor; }
@Override public ReceiveBufferSizePredictor getPredictor() throws Exception { return receiveBufferSizePredictor; }
/** * Returns the {@link ReceiveBufferSizePredictor} which predicts the * number of readable bytes in the socket receive buffer. The default * predictor is <tt>{@link AdaptiveReceiveBufferSizePredictor}(64, 1024, 65536)</tt>. */ ReceiveBufferSizePredictor getReceiveBufferSizePredictor();
/** * Sets the {@link ReceiveBufferSizePredictor} which predicts the * number of readable bytes in the socket receive buffer. The default * predictor is <tt>{@link AdaptiveReceiveBufferSizePredictor}(64, 1024, 65536)</tt>. */ void setReceiveBufferSizePredictor(ReceiveBufferSizePredictor predictor);