public class JettyXhrTransport extends AbstractXhrTransport implements Lifecycle
HttpClient
に基づく XHR トランスポート。 テスト目的(負荷テストなど)で使用する場合、HttpClient
プロパティを設定して、通常よりも多くの接続とスレッドを許可する必要があります。例:
HttpClient httpClient = new HttpClient(); httpClient.setMaxConnectionsPerDestination(1000); httpClient.setExecutor(new QueuedThreadPool(500));
logger, PRELUDE
コンストラクターと説明 |
---|
JettyXhrTransport(org.eclipse.jetty.client.HttpClient httpClient) |
修飾子と型 | メソッドと説明 |
---|---|
protected void | connectInternal(TransportRequest transportRequest, WebSocketHandler handler, URISE url, HttpHeaders handshakeHeaders, XhrClientSockJsSession session, SettableListenableFuture<WebSocketSession> connectFuture) |
protected ResponseEntity<StringSE> | executeInfoRequestInternal(URISE infoUrl, HttpHeaders headers) |
protected ResponseEntity<StringSE> | executeRequest(URISE url, org.eclipse.jetty.http.HttpMethod method, HttpHeaders headers, StringSE body) |
ResponseEntity<StringSE> | executeSendRequestInternal(URISE url, HttpHeaders headers, TextMessage message) |
org.eclipse.jetty.client.HttpClient | getHttpClient() |
boolean | isRunning() このコンポーネントが現在実行されているかどうかを確認します。 |
void | start() このコンポーネントを起動します。 |
void | stop() このメソッドを返すとコンポーネントが完全に停止するように、通常は同期的にこのコンポーネントを停止します。 |
connect, executeInfoRequest, executeSendRequest, getTransportTypes, isXhrStreamingDisabled, setXhrStreamingDisabled
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public JettyXhrTransport(org.eclipse.jetty.client.HttpClient httpClient)
public org.eclipse.jetty.client.HttpClient getHttpClient()
public void start()
Lifecycle
コンポーネントがすでに実行されている場合は、例外をスローしないでください。
コンテナーの場合、これは適用されるすべてのコンポーネントに開始信号を伝播します。
Lifecycle
の start
SmartLifecycle.isAutoStartup()
public void stop()
Lifecycle
SmartLifecycle
とその stop(Runnable)
バリアントの実装を検討してください。 この停止通知は破棄前に送信されるとは限らないことに注意してください。通常のシャットダウンでは、一般的な破棄コールバックが伝播される前に、Lifecycle
Bean は最初に停止通知を受信します。ただし、コンテキストの存続期間中のホットリフレッシュまたは中断されたリフレッシュ試行では、特定の Bean の destroy メソッドが、停止信号を事前に考慮することなく呼び出されます。
コンポーネントが実行されていない(まだ開始されていない)場合は、例外をスローしないでください。
コンテナーの場合、これは停止信号を適用するすべてのコンポーネントに伝播します。
Lifecycle
の stop
SmartLifecycle.stop(Runnable)
, DisposableBean.destroy()
public boolean isRunning()
Lifecycle
コンテナーの場合、これは、適用されるすべてのコンポーネントが現在実行されている場合にのみ、true
を返します。
protected void connectInternal(TransportRequest transportRequest, WebSocketHandler handler, URISE url, HttpHeaders handshakeHeaders, XhrClientSockJsSession session, SettableListenableFuture<WebSocketSession> connectFuture)
AbstractXhrTransport
の connectInternal
protected ResponseEntity<StringSE> executeInfoRequestInternal(URISE infoUrl, HttpHeaders headers)
AbstractXhrTransport
の executeInfoRequestInternal
public ResponseEntity<StringSE> executeSendRequestInternal(URISE url, HttpHeaders headers, TextMessage message)
AbstractXhrTransport
の executeSendRequestInternal
protected ResponseEntity<StringSE> executeRequest(URISE url, org.eclipse.jetty.http.HttpMethod method, HttpHeaders headers, @Nullable StringSE body)