org.eclipse.jetty.client.HttpClient .
When used for testing purposes (e.g. load testing) the HttpClient
properties must be set to allow a larger than usual number of connections and
threads. For example:
HttpClient httpClient = new HttpClient(); httpClient.setMaxConnectionsPerDestination(1000); httpClient.setExecutor(new QueuedThreadPool(500));
| Modifier and Type | Class and Description |
|---|---|
| private class | JettyXhrTransport.
Jetty client |
| Modifier and Type | Field and Description |
|---|---|
| private final HttpClient |
| Access | Constructor and Description |
|---|---|
| public |
| httpClient | back to summary |
|---|---|
| private final HttpClient httpClient | |
| JettyXhrTransport | back to summary |
|---|---|
| public JettyXhrTransport(HttpClient httpClient) | |
| addHttpHeaders | back to summary |
|---|---|
| private static void addHttpHeaders(Request request, HttpHeaders headers) | |
| connectInternal | back to summary |
|---|---|
| protected void connectInternal(TransportRequest transportRequest, WebSocketHandler handler, URI url, HttpHeaders handshakeHeaders, XhrClientSockJsSession session, CompletableFuture<WebSocketSession> connectFuture) Implements abstract org.
| |
| executeInfoRequestInternal | back to summary |
|---|---|
| protected ResponseEntity Implements abstract org.
| |
| executeReceiveRequest | back to summary |
|---|---|
| private void executeReceiveRequest(URI url, HttpHeaders headers, JettyXhrTransport. | |
| executeRequest | back to summary |
|---|---|
| protected ResponseEntity | |
| executeSendRequestInternal | back to summary |
|---|---|
| public ResponseEntity Implements abstract org.
| |
| getHttpClient | back to summary |
|---|---|
| public HttpClient getHttpClient() | |
| isRunning | back to summary |
|---|---|
| public boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |
| toHttpHeaders | back to summary |
|---|---|
| private static HttpHeaders toHttpHeaders(HttpFields httpFields) | |
Response
Listener that splits the body of the response into SockJS frames and
delegates them to the XhrClientSockJsSession.
| Modifier and Type | Field and Description |
|---|---|
| private final CompletableFuture | |
| private final ByteArrayOutputStream | |
| private final HttpHeaders | |
| private final XhrClientSockJsSession | |
| private final URI |
| Access | Constructor and Description |
|---|---|
| public | SockJsResponseListener(URI url, HttpHeaders headers, XhrClientSockJsSession sockJsSession, CompletableFuture<WebSocketSession> connectFuture)
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | onBegin(Response
the response containing the response line data response)Overrides default org. Callback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed. |
| public void | onContent(Response
the response containing the response line data and the headers response, ByteBuffer the content bytes received buffer)Overrides default org. Callback method invoked when the response content has been received, parsed and there is demand. |
| public void | onFailure(Response
the response containing data up to the point the failure happened response, Throwable the failure happened failure)Overrides default org. Callback method invoked when the response has failed in the process of being received |
| public void | onHeaders(Response
the response containing the response line data and the headers response)Overrides default org. Callback method invoked when all the response headers have been received and parsed. |
| public void | onSuccess(Response
the response containing the response line data and the headers response)Overrides default org. Callback method invoked when the whole response has been successfully received. |
| connectFuture | back to summary |
|---|---|
| private final CompletableFuture<WebSocketSession> connectFuture | |
| outputStream | back to summary |
|---|---|
| private final ByteArrayOutputStream outputStream | |
| receiveHeaders | back to summary |
|---|---|
| private final HttpHeaders receiveHeaders | |
| sockJsSession | back to summary |
|---|---|
| private final XhrClientSockJsSession sockJsSession | |
| transportUrl | back to summary |
|---|---|
| private final URI transportUrl | |
| SockJsResponseListener | back to summary |
|---|---|
| public SockJsResponseListener(URI url, HttpHeaders headers, XhrClientSockJsSession sockJsSession, CompletableFuture<WebSocketSession> connectFuture) | |
| handleFrame | back to summary |
|---|---|
| private void handleFrame() | |
| onBegin | back to summary |
|---|---|
| public void onBegin(Response response) Overrides default org. Doc from org. Callback method invoked when the response line containing HTTP version, HTTP status code and reason has been received and parsed. This method is the best approximation to detect when the first bytes of the response arrived to the client. | |
| onContent | back to summary |
|---|---|
| public void onContent(Response response, ByteBuffer buffer) Overrides default org. Doc from org. Callback method invoked when the response content has been received, parsed and there is demand.
This method may be invoked multiple times, and the
| |
| onFailure | back to summary |
|---|---|
| public void onFailure(Response response, Throwable failure) Overrides default org. Doc from org. Callback method invoked when the response has failed in the process of being received | |
| onHeaders | back to summary |
|---|---|
| public void onHeaders(Response response) Overrides default org. Doc from org. Callback method invoked when all the response headers have been received and parsed. | |
| onSuccess | back to summary |
|---|---|
| public void onSuccess(Response response) Overrides default org. Doc from org. Callback method invoked when the whole response has been successfully received. | |