List of usage examples for io.netty.util.internal ObjectUtil checkPositive
public static long checkPositive(long i, String name)
From source file:com.linecorp.armeria.internal.FlushConsolidationHandler.java
License:Apache License
/** * Create new instance./* ww w .j ava2 s. co m*/ * * @param explicitFlushAfterFlushes the number of flushes after which an explicit flush will be done. */ public FlushConsolidationHandler(int explicitFlushAfterFlushes) { this.explicitFlushAfterFlushes = ObjectUtil.checkPositive(explicitFlushAfterFlushes, "explicitFlushAfterFlushes"); }
From source file:com.linkedin.r2.transport.http.client.Http2StreamCodecBuilder.java
License:Apache License
public Http2StreamCodecBuilder maxContentLength(long maxContentLength) { ObjectUtil.checkPositive(maxContentLength, "maxContentLength"); _maxContentLength = maxContentLength; return self(); }
From source file:com.linkedin.r2.transport.http.client.Http2StreamCodecBuilder.java
License:Apache License
public Http2StreamCodecBuilder streamingTimeout(long streamingTimeout) { ObjectUtil.checkPositive(streamingTimeout, "streamingTimeout"); _streamingTimeout = streamingTimeout; return self(); }
From source file:com.linkedin.r2.transport.http.client.Http2StreamCodecBuilder.java
License:Apache License
public Http2StreamCodecBuilder gracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis) { ObjectUtil.checkPositive(gracefulShutdownTimeoutMillis, "gracefulShutdownTimeoutMillis"); _gracefulShutdownTimeoutMillis = gracefulShutdownTimeoutMillis; return self(); }
From source file:com.linkedin.r2.transport.http.client.Http2StreamCodecBuilder.java
License:Apache License
public Http2StreamCodecBuilder maxHeaderSize(int maxHeaderSize) { ObjectUtil.checkPositive(maxHeaderSize, "maxHeaderSize"); _maxHeaderSize = maxHeaderSize;//from w w w . ja va 2 s. com return self(); }
From source file:com.linkedin.r2.transport.http.client.Http2StreamCodecBuilder.java
License:Apache License
@Override public Http2StreamCodec build() { ObjectUtil.checkNotNull(_connection, "connection"); ObjectUtil.checkPositive(_maxHeaderSize, "maxHeaderSize"); Http2HeadersDecoder headerDecoder = new DefaultHttp2HeadersDecoder(_maxHeaderSize, Http2CodecUtil.DEFAULT_HEADER_TABLE_SIZE, isValidateHeaders(), INITIAL_HUFFMAN_DECODE_CAPACITY); Http2FrameReader reader = new DefaultHttp2FrameReader(headerDecoder); Http2FrameWriter writer = new DefaultHttp2FrameWriter(headerSensitivityDetector()); if (frameLogger() != null) { reader = new Http2InboundFrameLogger(reader, frameLogger()); writer = new Http2OutboundFrameLogger(writer, frameLogger()); }//from w ww.j av a2 s . c o m Http2ConnectionEncoder encoder = new DefaultHttp2ConnectionEncoder(_connection, writer); boolean encoderEnforceMaxConcurrentStreams = encoderEnforceMaxConcurrentStreams(); if (encoderEnforceMaxConcurrentStreams) { if (_connection.isServer()) { encoder.close(); reader.close(); throw new IllegalArgumentException("encoderEnforceMaxConcurrentStreams: " + encoderEnforceMaxConcurrentStreams + " not supported for server"); } encoder = new StreamBufferingEncoder(encoder); } Http2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(_connection, encoder, reader); super.codec(decoder, encoder); return super.build(); }
From source file:com.linkedin.r2.transport.http.client.Http2StreamCodecBuilder.java
License:Apache License
@Override protected Http2StreamCodec build(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder, Http2Settings initialSettings) throws Exception { ObjectUtil.checkPositive(_maxContentLength, "maxContentLength"); ObjectUtil.checkPositive(_gracefulShutdownTimeoutMillis, "gracefulShutdownTimeoutMillis"); ObjectUtil.checkNotNull(_scheduler, "scheduler"); ObjectUtil.checkNotNull(_connection, "connection"); Http2StreamCodec codec = new Http2StreamCodec(decoder, encoder, initialSettings); super.frameListener( new Http2FrameListener(_scheduler, _connection, codec, _maxContentLength, _streamingTimeout)); super.gracefulShutdownTimeoutMillis(_gracefulShutdownTimeoutMillis); return codec; }
From source file:io.grpc.netty.Http2ControlFrameLimitEncoder.java
License:Apache License
Http2ControlFrameLimitEncoder(Http2ConnectionEncoder delegate, int maxOutstandingControlFrames) { super(delegate); this.maxOutstandingControlFrames = ObjectUtil.checkPositive(maxOutstandingControlFrames, "maxOutstandingControlFrames"); }