APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.net.http

pack-priv Class PlainHttpConnection

extends HttpConnection
Class Inheritance
Known Direct Subclasses
jdk.internal.net.http.PlainProxyConnection
Imports
java.io.IOException, java.net.ConnectException, .InetSocketAddress, .StandardSocketOptions, java.nio.channels.SelectableChannel, .SelectionKey, .SocketChannel, java.time.Duration, java.util.concurrent.CompletableFuture, java.util.concurrent.atomic.AtomicReference, java.util.concurrent.locks.ReentrantLock, jdk.internal.net.http.common.FlowTube, .Log, .MinimalFuture, .Utils

Plain raw TCP connection direct to destination. The connection operates in asynchronous non-blocking mode. All reads and writes are done non-blocking.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
protected final SocketChannel
private volatile boolean
private volatile boolean
private volatile PlainHttpConnection.ConnectTimerEvent
private final AtomicReference<Throwable>
private final ReentrantLock
private final SocketTube
private final HttpConnection.PlainHttpPublisher
Inherited from jdk.internal.net.http.HttpConnection:
addressCOMPARE_BY_IDdbgTagdebugDEBUG_LOGGER

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv ConnectionPool.CacheKey
pack-priv SocketChannel
public void
close()

Implements abstract jdk.internal.net.http.HttpConnection.close.

Implements java.io.Closeable.close.

Closes this connection.

pack-priv void
close(Throwable cause)

Implements abstract jdk.internal.net.http.HttpConnection.close.

Closes this connection due to the given cause.

public CompletableFuture<Void>
connectAsync(Exchange<?> exchange)

Implements abstract jdk.internal.net.http.HttpConnection.connectAsync.

Initiates the connect phase.

pack-priv boolean
connected()

Implements abstract jdk.internal.net.http.HttpConnection.connected.

Tells whether, or not, this connection is connected to its destination.

pack-priv boolean
public CompletableFuture<Void>
finishConnect()

Implements abstract jdk.internal.net.http.HttpConnection.finishConnect.

Finishes the connection phase.

pack-priv final FlowTube
getConnectionFlow()

Implements abstract jdk.internal.net.http.HttpConnection.getConnectionFlow.

Returns the underlying connection flow, if applicable.

pack-priv Throwable
pack-priv boolean
isProxied()

Implements abstract jdk.internal.net.http.HttpConnection.isProxied.

Tells whether, or not, this connection is proxied.

pack-priv boolean
isSecure()

Implements abstract jdk.internal.net.http.HttpConnection.isSecure.

Tells whether, or not, this connection is secure ( over SSL )

private PlainHttpConnection.ConnectTimerEvent
newConnectTimer(Exchange<?> exchange, CompletableFuture<?> cf)

Returns a ConnectTimerEvent iff there is a connect timeout duration, otherwise null.

pack-priv InetSocketAddress
proxy()

Implements abstract jdk.internal.net.http.HttpConnection.proxy.

Returns the address of the proxy used by this connection.

pack-priv HttpConnection.HttpPublisher
publisher()

Implements abstract jdk.internal.net.http.HttpConnection.publisher.

Returns the HTTP publisher associated with this connection.

public String
toString()

Overrides jdk.internal.net.http.HttpConnection.toString.

Returns a string representation of the object.

Inherited from jdk.internal.net.http.HttpConnection:
addressaddTrailingOperationcheckOpenclientcloseOrReturnToCachecontextRestricteddbgStringgetConnectiongetOriginServergetSNIServerNamesheaderFilterisFlowFinishedisOpenisTunnellabelnewConnectionId

Field Detail

chanback to summary
protected final SocketChannel chan
closedback to summary
private volatile boolean closed
connectedback to summary
private volatile boolean connected
connectTimerEventback to summary
private volatile PlainHttpConnection.ConnectTimerEvent connectTimerEvent
errorRefback to summary
private final AtomicReference<Throwable> errorRef
stateLockback to summary
private final ReentrantLock stateLock
tubeback to summary
private final SocketTube tube
writePublisherback to summary
private final HttpConnection.PlainHttpPublisher writePublisher

Constructor Detail

PlainHttpConnectionback to summary
pack-priv PlainHttpConnection(Origin originServer, InetSocketAddress addr, HttpClientImpl client, String label)

Method Detail

cacheKeyback to summary
pack-priv ConnectionPool.CacheKey cacheKey()

Implements abstract jdk.internal.net.http.HttpConnection.cacheKey.

Annotations
@Override
channelback to summary
pack-priv SocketChannel channel()

Implements abstract jdk.internal.net.http.HttpConnection.channel.

Annotations
@Override
closeback to summary
public void close()

Implements abstract jdk.internal.net.http.HttpConnection.close.

Implements java.io.Closeable.close.

Doc from jdk.internal.net.http.HttpConnection.close.

Closes this connection.

Annotations
@Override
closeback to summary
pack-priv void close(Throwable cause)

Implements abstract jdk.internal.net.http.HttpConnection.close.

Doc from jdk.internal.net.http.HttpConnection.close.

Closes this connection due to the given cause.

Annotations
@Override
connectAsyncback to summary
public CompletableFuture<Void> connectAsync(Exchange<?> exchange)

Implements abstract jdk.internal.net.http.HttpConnection.connectAsync.

Doc from jdk.internal.net.http.HttpConnection.connectAsync.

Initiates the connect phase. Returns a CompletableFuture that completes when the underlying TCP connection has been established or an error occurs.

Annotations
@Override
connectedback to summary
pack-priv boolean connected()

Implements abstract jdk.internal.net.http.HttpConnection.connected.

Doc from jdk.internal.net.http.HttpConnection.connected.

Tells whether, or not, this connection is connected to its destination.

Annotations
@Override
connectionOpenedback to summary
pack-priv boolean connectionOpened()
finishConnectback to summary
public CompletableFuture<Void> finishConnect()

Implements abstract jdk.internal.net.http.HttpConnection.finishConnect.

Doc from jdk.internal.net.http.HttpConnection.finishConnect.

Finishes the connection phase. Returns a CompletableFuture that completes when any additional, type specific, setup has been done. Must be called after connectAsync.

Annotations
@Override
getConnectionFlowback to summary
pack-priv final FlowTube getConnectionFlow()

Implements abstract jdk.internal.net.http.HttpConnection.getConnectionFlow.

Doc from jdk.internal.net.http.HttpConnection.getConnectionFlow.

Returns the underlying connection flow, if applicable.

Annotations
@Override
getErrorback to summary
pack-priv Throwable getError(Throwable cause)
isProxiedback to summary
pack-priv boolean isProxied()

Implements abstract jdk.internal.net.http.HttpConnection.isProxied.

Doc from jdk.internal.net.http.HttpConnection.isProxied.

Tells whether, or not, this connection is proxied. Returns true for tunnel connections, or clear connection to any host through proxy.

Annotations
@Override
isSecureback to summary
pack-priv boolean isSecure()

Implements abstract jdk.internal.net.http.HttpConnection.isSecure.

Doc from jdk.internal.net.http.HttpConnection.isSecure.

Tells whether, or not, this connection is secure ( over SSL )

Annotations
@Override
newConnectTimerback to summary
private PlainHttpConnection.ConnectTimerEvent newConnectTimer(Exchange<?> exchange, CompletableFuture<?> cf)

Returns a ConnectTimerEvent iff there is a connect timeout duration, otherwise null.

proxyback to summary
pack-priv InetSocketAddress proxy()

Implements abstract jdk.internal.net.http.HttpConnection.proxy.

Doc from jdk.internal.net.http.HttpConnection.proxy.

Returns the address of the proxy used by this connection. Returns the proxy address for tunnel connections, or clear connection to any host through proxy. Returns null otherwise.

Annotations
@Override
publisherback to summary
pack-priv HttpConnection.HttpPublisher publisher()

Implements abstract jdk.internal.net.http.HttpConnection.publisher.

Doc from jdk.internal.net.http.HttpConnection.publisher.

Returns the HTTP publisher associated with this connection. May be null if invoked before connecting.

Annotations
@Override
toStringback to summary
public String toString()

Overrides jdk.internal.net.http.HttpConnection.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
jdk.internal.net.http back to summary

pack-priv final Class PlainHttpConnection.ConnectEvent

extends AsyncEvent
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final CompletableFuture<Void>
private final Exchange<?>
Inherited from jdk.internal.net.http.AsyncEvent:
flagsREPEATING

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
abort(IOException ioe)

Implements abstract jdk.internal.net.http.AsyncEvent.abort.

Called when an error occurs during registration, or when the selector has been shut down.

public SelectableChannel
channel()

Implements abstract jdk.internal.net.http.AsyncEvent.channel.

Returns the channel

public void
handle()

Implements abstract jdk.internal.net.http.AsyncEvent.handle.

Called when event occurs

public int
interestOps()

Implements abstract jdk.internal.net.http.AsyncEvent.interestOps.

Returns the selector interest op flags OR'd

Inherited from jdk.internal.net.http.AsyncEvent:
repeating

Field Detail

cfback to summary
private final CompletableFuture<Void> cf
exchangeback to summary
private final Exchange<?> exchange

Constructor Detail

ConnectEventback to summary
pack-priv ConnectEvent(CompletableFuture<Void> cf, Exchange<?> exchange)

Method Detail

abortback to summary
public void abort(IOException ioe)

Implements abstract jdk.internal.net.http.AsyncEvent.abort.

Doc from jdk.internal.net.http.AsyncEvent.abort.

Called when an error occurs during registration, or when the selector has been shut down. Aborts all exchanges.

Annotations
@Override
channelback to summary
public SelectableChannel channel()

Implements abstract jdk.internal.net.http.AsyncEvent.channel.

Doc from jdk.internal.net.http.AsyncEvent.channel.

Returns the channel

Annotations
@Override
handleback to summary
public void handle()

Implements abstract jdk.internal.net.http.AsyncEvent.handle.

Doc from jdk.internal.net.http.AsyncEvent.handle.

Called when event occurs

Annotations
@Override
interestOpsback to summary
public int interestOps()

Implements abstract jdk.internal.net.http.AsyncEvent.interestOps.

Doc from jdk.internal.net.http.AsyncEvent.interestOps.

Returns the selector interest op flags OR'd

Annotations
@Override
jdk.internal.net.http back to summary

pack-priv final Class PlainHttpConnection.ConnectTimerEvent

extends TimeoutEvent
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final CompletableFuture<?>
private final Exchange<?>

Constructor Summary

AccessConstructor and Description
pack-priv
ConnectTimerEvent(Duration duration, Exchange<?> exchange, CompletableFuture<?> cf)

Method Summary

Modifier and TypeMethod and Description
public void
public String
toString()

Overrides jdk.internal.net.http.TimeoutEvent.toString.

Returns a string representation of the object.

Inherited from jdk.internal.net.http.TimeoutEvent:
compareTodeadline

Field Detail

cfback to summary
private final CompletableFuture<?> cf
exchangeback to summary
private final Exchange<?> exchange

Constructor Detail

ConnectTimerEventback to summary
pack-priv ConnectTimerEvent(Duration duration, Exchange<?> exchange, CompletableFuture<?> cf)

Method Detail

handleback to summary
public void handle()

Implements abstract jdk.internal.net.http.TimeoutEvent.handle.

Annotations
@Override
toStringback to summary
public String toString()

Overrides jdk.internal.net.http.TimeoutEvent.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override