类 JettyXhrTransport
- java.lang.Object
- org.springframework.web.socket.sockjs.client.AbstractXhrTransport
- org.springframework.web.socket.sockjs.client.JettyXhrTransport
- 所有已实现的接口:
Lifecycle
,InfoReceiver
,Transport
,XhrTransport
public class JettyXhrTransport extends AbstractXhrTransport implements Lifecycle
An XHR transport based on Jetty'sHttpClient
.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));
- 从以下版本开始:
- 4.1
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.socket.sockjs.client.AbstractXhrTransport
logger, PRELUDE
构造器概要
构造器 构造器 说明 JettyXhrTransport(org.eclipse.jetty.client.HttpClient httpClient)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
connectInternal(TransportRequest transportRequest, WebSocketHandler handler, URI url, HttpHeaders handshakeHeaders, XhrClientSockJsSession session, SettableListenableFuture<WebSocketSession> connectFuture)
protected ResponseEntity<String>
executeInfoRequestInternal(URI infoUrl, HttpHeaders headers)
protected ResponseEntity<String>
executeRequest(URI url, org.eclipse.jetty.http.HttpMethod method, HttpHeaders headers, String body)
ResponseEntity<String>
executeSendRequestInternal(URI url, HttpHeaders headers, TextMessage message)
org.eclipse.jetty.client.HttpClient
getHttpClient()
boolean
isRunning()
Check whether this component is currently running.void
start()
Start this component.void
stop()
Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method.从类继承的方法 org.springframework.web.socket.sockjs.client.AbstractXhrTransport
connect, executeInfoRequest, executeSendRequest, getRequestHeaders, getTransportTypes, isXhrStreamingDisabled, setRequestHeaders, setXhrStreamingDisabled, toString
构造器详细资料
JettyXhrTransport
public JettyXhrTransport(org.eclipse.jetty.client.HttpClient httpClient)
方法详细资料
getHttpClient
public org.eclipse.jetty.client.HttpClient getHttpClient()
start
public void start()
从接口复制的说明:Lifecycle
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.
- 指定者:
start
在接口中Lifecycle
- 另请参阅:
SmartLifecycle.isAutoStartup()
stop
public void stop()
从接口复制的说明:Lifecycle
Stop this component, typically in a synchronous fashion, such that the component is fully stopped upon return of this method. Consider implementingSmartLifecycle
and itsstop(Runnable)
variant when asynchronous stop behavior is necessary.Note that this stop notification is not guaranteed to come before destruction: On regular shutdown,
Lifecycle
beans will first receive a stop notification before the general destruction callbacks are being propagated; however, on hot refresh during a context's lifetime or on aborted refresh attempts, a given bean's destroy method will be called without any consideration of stop signals upfront.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.
- 指定者:
stop
在接口中Lifecycle
- 另请参阅:
SmartLifecycle.stop(Runnable)
,DisposableBean.destroy()
isRunning
public boolean isRunning()
从接口复制的说明:Lifecycle
Check whether this component is currently running.In the case of a container, this will return
true
only if all components that apply are currently running.
connectInternal
protected void connectInternal(TransportRequest transportRequest, WebSocketHandler handler, URI url, HttpHeaders handshakeHeaders, XhrClientSockJsSession session, SettableListenableFuture<WebSocketSession> connectFuture)
- 指定者:
connectInternal
在类中AbstractXhrTransport
executeInfoRequestInternal
protected ResponseEntity<String> executeInfoRequestInternal(URI infoUrl, HttpHeaders headers)
executeSendRequestInternal
public ResponseEntity<String> executeSendRequestInternal(URI url, HttpHeaders headers, TextMessage message)
executeRequest
protected ResponseEntity<String> executeRequest(URI url, org.eclipse.jetty.http.HttpMethod method, HttpHeaders headers, String body)