提交 e90143e0 编写于 作者: J Juergen Hoeller

Polishing

上级 9c46cb6f
...@@ -109,7 +109,7 @@ final class SimpleStreamingAsyncClientHttpRequest extends AbstractAsyncClientHtt ...@@ -109,7 +109,7 @@ final class SimpleStreamingAsyncClientHttpRequest extends AbstractAsyncClientHtt
@Override @Override
protected ListenableFuture<ClientHttpResponse> executeInternal(final HttpHeaders headers) throws IOException { protected ListenableFuture<ClientHttpResponse> executeInternal(final HttpHeaders headers) throws IOException {
return taskExecutor.submitListenable(new Callable<ClientHttpResponse>() { return this.taskExecutor.submitListenable(new Callable<ClientHttpResponse>() {
@Override @Override
public ClientHttpResponse call() throws Exception { public ClientHttpResponse call() throws Exception {
try { try {
......
...@@ -74,9 +74,8 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { ...@@ -74,9 +74,8 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
/** /**
* Constructor accepting an existing {@link WebSocketContainer} instance. * Constructor accepting an existing {@link WebSocketContainer} instance.
* * <p>For XML configuration, see {@link WebSocketContainerFactoryBean}. For Java
* <p>For XML configuration see {@link WebSocketContainerFactoryBean}. For Java * configuration, use {@code ContainerProvider.getWebSocketContainer()} to obtain
* configuration use {@code ContainerProvider.getWebSocketContainer()} to obtain
* the {@code WebSocketContainer} instance. * the {@code WebSocketContainer} instance.
*/ */
public StandardWebSocketClient(WebSocketContainer webSocketContainer) { public StandardWebSocketClient(WebSocketContainer webSocketContainer) {
...@@ -89,8 +88,7 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { ...@@ -89,8 +88,7 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
* Set an {@link AsyncListenableTaskExecutor} to use when opening connections. * Set an {@link AsyncListenableTaskExecutor} to use when opening connections.
* If this property is set to {@code null}, calls to any of the * If this property is set to {@code null}, calls to any of the
* {@code doHandshake} methods will block until the connection is established. * {@code doHandshake} methods will block until the connection is established.
* * <p>By default, an instance of {@code SimpleAsyncTaskExecutor} is used.
* <p>By default an instance of {@code SimpleAsyncTaskExecutor} is used.
*/ */
public void setTaskExecutor(AsyncListenableTaskExecutor taskExecutor) { public void setTaskExecutor(AsyncListenableTaskExecutor taskExecutor) {
this.taskExecutor = taskExecutor; this.taskExecutor = taskExecutor;
......
...@@ -106,11 +106,9 @@ public abstract class AbstractSockJsService implements SockJsService { ...@@ -106,11 +106,9 @@ public abstract class AbstractSockJsService implements SockJsService {
* iframe so that code in the iframe can run from a domain local to the SockJS * iframe so that code in the iframe can run from a domain local to the SockJS
* server. Since the iframe needs to load the SockJS javascript client library, * server. Since the iframe needs to load the SockJS javascript client library,
* this property allows specifying where to load it from. * this property allows specifying where to load it from.
*
* <p>By default this is set to point to * <p>By default this is set to point to
* "https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.4.min.js". However it can * "https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.4.min.js".
* also be set to point to a URL served by the application. * However, it can also be set to point to a URL served by the application.
*
* <p>Note that it's possible to specify a relative URL in which case the URL * <p>Note that it's possible to specify a relative URL in which case the URL
* must be relative to the iframe URL. For example assuming a SockJS endpoint * must be relative to the iframe URL. For example assuming a SockJS endpoint
* mapped to "/sockjs", and resulting iframe URL "/sockjs/iframe.html", then the * mapped to "/sockjs", and resulting iframe URL "/sockjs/iframe.html", then the
...@@ -153,16 +151,13 @@ public abstract class AbstractSockJsService implements SockJsService { ...@@ -153,16 +151,13 @@ public abstract class AbstractSockJsService implements SockJsService {
* clients with a "cookie_needed" boolean property that indicates whether the use of a * clients with a "cookie_needed" boolean property that indicates whether the use of a
* JSESSIONID cookie is required for the application to function correctly, e.g. for * JSESSIONID cookie is required for the application to function correctly, e.g. for
* load balancing or in Java Servlet containers for the use of an HTTP session. * load balancing or in Java Servlet containers for the use of an HTTP session.
*
* <p>This is especially important for IE 8,9 that support XDomainRequest -- a modified * <p>This is especially important for IE 8,9 that support XDomainRequest -- a modified
* AJAX/XHR -- that can do requests across domains but does not send any cookies. In * AJAX/XHR -- that can do requests across domains but does not send any cookies. In
* those cases, the SockJS client prefers the "iframe-htmlfile" transport over * those cases, the SockJS client prefers the "iframe-htmlfile" transport over
* "xdr-streaming" in order to be able to send cookies. * "xdr-streaming" in order to be able to send cookies.
*
* <p>The SockJS protocol also expects a SockJS service to echo back the JSESSIONID * <p>The SockJS protocol also expects a SockJS service to echo back the JSESSIONID
* cookie when this property is set to true. However, when running in a Servlet * cookie when this property is set to true. However, when running in a Servlet
* container this is not necessary since the container takes care of it. * container this is not necessary since the container takes care of it.
*
* <p>The default value is "true" to maximize the chance for applications to work * <p>The default value is "true" to maximize the chance for applications to work
* correctly in IE 8,9 with support for cookies (and the JSESSIONID cookie in * correctly in IE 8,9 with support for cookies (and the JSESSIONID cookie in
* particular). However, an application can choose to set this to "false" if * particular). However, an application can choose to set this to "false" if
...@@ -363,7 +358,6 @@ public abstract class AbstractSockJsService implements SockJsService { ...@@ -363,7 +358,6 @@ public abstract class AbstractSockJsService implements SockJsService {
protected void addCorsHeaders(ServerHttpRequest request, ServerHttpResponse response, HttpMethod... httpMethods) { protected void addCorsHeaders(ServerHttpRequest request, ServerHttpResponse response, HttpMethod... httpMethods) {
HttpHeaders requestHeaders = request.getHeaders(); HttpHeaders requestHeaders = request.getHeaders();
HttpHeaders responseHeaders = response.getHeaders(); HttpHeaders responseHeaders = response.getHeaders();
...@@ -444,6 +438,7 @@ public abstract class AbstractSockJsService implements SockJsService { ...@@ -444,6 +438,7 @@ public abstract class AbstractSockJsService implements SockJsService {
} }
}; };
private final SockJsRequestHandler iframeHandler = new SockJsRequestHandler() { private final SockJsRequestHandler iframeHandler = new SockJsRequestHandler() {
private static final String IFRAME_CONTENT = private static final String IFRAME_CONTENT =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册