Implementation Specification
Though the facade strongly reference its implementation, the implementation MUST NOT strongly reference the facade. It MAY use weak references if needed.
Modifier and Type | Field and Description |
---|---|
pack-priv static final Cleaner | |
pack-priv final HttpClientImpl |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public Optional | authenticator()
Implements abstract java. Returns an |
public boolean | awaitTermination(Duration
the maximum time to wait duration)Overrides java. Blocks until all operations have completed execution after a shutdown
request, or the |
public void | close()
Overrides java. Implements java. Initiates an orderly shutdown in which requests previously
submitted to |
public Optional | connectTimeout()
Implements abstract java. Returns an |
public Optional | cookieHandler()
Implements abstract java. Returns an |
public Optional | executor()
Implements abstract java. Returns an |
public HttpClient. | followRedirects()
Implements abstract java. Returns the follow redirects policy for this client. |
public OperationTrackers. | |
public boolean | isTerminated()
Overrides java. Returns |
public WebSocket. | newWebSocketBuilder()
Overrides java. Creates a new |
public Optional | proxy()
Implements abstract java. Returns an |
public <T> HttpResponse | send(HttpRequest
the request req, HttpResponse.the response body handler responseBodyHandlerImplements abstract java. Sends the given request using this client, blocking if necessary to get the response. |
public <T> CompletableFuture | sendAsync(HttpRequest
the request req, HttpResponse.the response body handler responseBodyHandlerImplements abstract java. Sends the given request asynchronously using this client with the given response body handler. |
public <T> CompletableFuture | sendAsync(HttpRequest
the request req, HttpResponse.the response body handler responseBodyHandler,push promise handler, may be null pushPromiseHandlerImplements abstract java. Sends the given request asynchronously using this client with the given response body handler and push promise handler. |
public void | shutdown()
Overrides java. Initiates an orderly shutdown in which requests previously
submitted with |
public void | shutdownNow()
Overrides java. This method attempts to initiate an immediate shutdown. |
public SSLContext | sslContext()
Implements abstract java. Returns this client's |
public SSLParameters | sslParameters()
Implements abstract java. Returns a copy of this client's |
public Executor | |
public String | |
public HttpClient. | version()
Implements abstract java. Returns the preferred HTTP protocol version for this client. |
cleaner | back to summary |
---|---|
pack-priv static final Cleaner cleaner |
impl | back to summary |
---|---|
pack-priv final HttpClientImpl impl |
HttpClientFacade | back to summary |
---|---|
pack-priv HttpClientFacade(HttpClientImpl impl) Creates an HttpClientFacade. |
authenticator | back to summary |
---|---|
public Optional Implements abstract java. Doc from java. Returns an
|
awaitTermination | back to summary |
---|---|
public boolean awaitTermination(Duration duration) throws InterruptedException Overrides java. Doc from java. Blocks until all operations have completed execution after a shutdown
request, or the This method does not wait if the duration to wait is less than or equal to zero. In this case, the method just tests if the thread has terminated.
|
close | back to summary |
---|---|
public void close() Overrides java. Implements java. Doc from java. Initiates an orderly shutdown in which requests previously
submitted to If interrupted while waiting, this method may attempt to stop all
operations by calling If already terminated, invoking this method has no effect.
|
connectTimeout | back to summary |
---|---|
public Optional Implements abstract java. Doc from java. Returns an |
cookieHandler | back to summary |
---|---|
public Optional Implements abstract java. Doc from java. Returns an
|
executor | back to summary |
---|---|
public Optional Implements abstract java. Doc from java. Returns an Even though this method may return an empty optional, the |
followRedirects | back to summary |
---|---|
public HttpClient. Implements abstract java. Doc from java. Returns the follow redirects policy for this client. The default value
for client's built by builders that do not specify a redirect policy is
|
getOperationsTracker | back to summary |
---|---|
public OperationTrackers. Implements jdk.
|
isTerminated | back to summary |
---|---|
public boolean isTerminated() Overrides java. Doc from java. Returns Note that
|
newWebSocketBuilder | back to summary |
---|---|
public WebSocket. Overrides java. Doc from java. Creates a new Example HttpClient client = HttpClient.newHttpClient();
CompletableFuture<WebSocket> ws = client.newWebSocketBuilder()
.buildAsync(URI.create("ws://websocket.example.com"), listener);
Finer control over the WebSocket Opening Handshake can be achieved
by using a custom Example InetSocketAddress addr = new InetSocketAddress("proxy.example.com", 80);
HttpClient client = HttpClient.newBuilder()
.proxy(ProxySelector.of(addr))
.build();
CompletableFuture<WebSocket> ws = client.newWebSocketBuilder()
.buildAsync(URI.create("ws://websocket.example.com"), listener);
|
proxy | back to summary |
---|---|
public Optional Implements abstract java. Doc from java. Returns an Even though this method may return an empty optional, the
|
send | back to summary |
---|---|
public <T> HttpResponse Implements abstract java. Doc from java. Sends the given request using this client, blocking if necessary to get
the response. The returned If the operation is interrupted, the default
|
sendAsync | back to summary |
---|---|
public <T> CompletableFuture Implements abstract java. Doc from java. Sends the given request asynchronously using this client with the given response body handler. Equivalent to:
|
sendAsync | back to summary |
---|---|
public <T> CompletableFuture Implements abstract java. Doc from java. Sends the given request asynchronously using this client with the given response body handler and push promise handler. The returned completable future, if completed successfully, completes
with an Push promises received, if any, are
handled by the given The returned completable future completes exceptionally with:
The default
|
shutdown | back to summary |
---|---|
public void shutdown() Overrides java. Doc from java. Initiates an orderly shutdown in which requests previously
submitted with This method does not wait for previously submitted request
to complete execution. Use
|
shutdownNow | back to summary |
---|---|
public void shutdownNow() Overrides java. Doc from java. This method attempts to initiate an immediate shutdown.
An implementation of this method may attempt to
interrupt operations that are actively running.
Operations are any tasks required to run a request previously
submitted with
|
sslContext | back to summary |
---|---|
public SSLContext sslContext() Implements abstract java. Doc from java. Returns this client's If no
|
sslParameters | back to summary |
---|---|
public SSLParameters sslParameters() Implements abstract java. Doc from java. Returns a copy of this client's If no
|
theExecutor | back to summary |
---|---|
public Executor theExecutor() |
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- |
version | back to summary |
---|---|
public HttpClient. Implements abstract java. Doc from java. Returns the preferred HTTP protocol version for this client. The default
value is
|