org.apache.coyote.Adapter Java Examples

The following examples show how to use org.apache.coyote.Adapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Http2Protocol.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
@Override
public InternalHttpUpgradeHandler getInternalUpgradeHandler(Adapter adapter,
        Request coyoteRequest) {
    Http2UpgradeHandler result = new Http2UpgradeHandler(this, adapter, coyoteRequest);

    result.setReadTimeout(getReadTimeout());
    result.setKeepAliveTimeout(getKeepAliveTimeout());
    result.setWriteTimeout(getWriteTimeout());
    result.setMaxConcurrentStreams(getMaxConcurrentStreams());
    result.setMaxConcurrentStreamExecution(getMaxConcurrentStreamExecution());
    result.setInitialWindowSize(getInitialWindowSize());
    result.setAllowedTrailerHeaders(allowedTrailerHeaders);
    result.setMaxHeaderCount(getMaxHeaderCount());
    result.setMaxHeaderSize(getMaxHeaderSize());
    result.setMaxTrailerCount(getMaxTrailerCount());
    result.setMaxTrailerSize(getMaxTrailerSize());
    result.setInitiatePingDisabled(initiatePingDisabled);
    return result;
}
 
Example #2
Source File: Http2UpgradeHandler.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
public Http2UpgradeHandler(Http2Protocol protocol, Adapter adapter, Request coyoteRequest) {
    super (STREAM_ID_ZERO);
    this.protocol = protocol;
    this.adapter = adapter;
    this.connectionId = Integer.toString(connectionIdGenerator.getAndIncrement());

    lastNonFinalDataPayload = protocol.getOverheadDataThreshold() * 2;
    lastWindowUpdate = protocol.getOverheadWindowUpdateThreshold() * 2;

    remoteSettings = new ConnectionSettingsRemote(connectionId);
    localSettings = new ConnectionSettingsLocal(connectionId);

    // Initial HTTP request becomes stream 1.
    if (coyoteRequest != null) {
        if (log.isDebugEnabled()) {
            log.debug(sm.getString("upgradeHandler.upgrade", connectionId));
        }
        Integer key = Integer.valueOf(1);
        Stream stream = new Stream(key, this, coyoteRequest);
        streams.put(key, stream);
        maxActiveRemoteStreamId = 1;
        activeRemoteStreamCount.set(1);
        maxProcessedStreamId = 1;
    }
}
 
Example #3
Source File: StreamProcessor.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
StreamProcessor(Http2UpgradeHandler handler, Stream stream, Adapter adapter,
        SocketWrapperBase<?> socketWrapper) {
    super(socketWrapper.getEndpoint(), stream.getCoyoteRequest(), stream.getCoyoteResponse());
    this.handler = handler;
    this.stream = stream;
    setAdapter(adapter);
    setSocketWrapper(socketWrapper);
}
 
Example #4
Source File: Http2Protocol.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
public Processor getProcessor(SocketWrapperBase<?> socketWrapper, Adapter adapter) {
    UpgradeProcessorInternal processor = new UpgradeProcessorInternal(socketWrapper,
            new UpgradeToken(getInternalUpgradeHandler(adapter, null), null, null));
    return processor;
}
 
Example #5
Source File: Tomcat90ProtocolHandler.java    From armeria with Apache License 2.0 4 votes vote down vote up
@Override
public void setAdapter(Adapter adapter) {
    this.adapter = adapter;
}
 
Example #6
Source File: Tomcat90ProtocolHandler.java    From armeria with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public Adapter getAdapter() {
    return adapter;
}