Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
chenpeng_fei
spring-framework
提交
90409cbe
S
spring-framework
项目概览
chenpeng_fei
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
90409cbe
编写于
9月 24, 2015
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Renamed Undertow10BufferSupport to UndertowXnioBufferSupport
Issue: SPR-13366
上级
7f700cc6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
13 deletion
+11
-13
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/UndertowXhrTransport.java
...mework/web/socket/sockjs/client/UndertowXhrTransport.java
+11
-13
未找到文件。
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/UndertowXhrTransport.java
浏览文件 @
90409cbe
...
...
@@ -69,7 +69,7 @@ import org.springframework.web.socket.sockjs.frame.SockJsFrame;
/**
* An XHR transport based on Undertow's {@link io.undertow.client.UndertowClient}.
* Compatible with Undertow
from version 1.0 to 1.3
.
* Compatible with Undertow
1.0 to 1.3, as of Spring Framework 4.2.2
.
*
* <p>When used for testing purposes (e.g. load testing) or for specific use cases
* (like HTTPS configuration), a custom OptionMap should be provided:
...
...
@@ -92,11 +92,11 @@ import org.springframework.web.socket.sockjs.frame.SockJsFrame;
*/
public
class
UndertowXhrTransport
extends
AbstractXhrTransport
{
private
static
final
boolean
undertow13Present
=
ClassUtils
.
isPresent
(
"io.undertow.connector.ByteBufferPool"
,
UndertowXhrTransport
.
class
.
getClassLoader
());
private
static
final
AttachmentKey
<
String
>
RESPONSE_BODY
=
AttachmentKey
.
create
(
String
.
class
);
private
static
final
boolean
undertow13Present
=
ClassUtils
.
isPresent
(
"io.undertow.connector.ByteBufferPool"
,
UndertowXhrTransport
.
class
.
getClassLoader
());
private
final
OptionMap
optionMap
;
...
...
@@ -116,12 +116,8 @@ public class UndertowXhrTransport extends AbstractXhrTransport {
this
.
optionMap
=
optionMap
;
this
.
httpClient
=
UndertowClient
.
getInstance
();
this
.
worker
=
Xnio
.
getInstance
().
createWorker
(
optionMap
);
if
(
undertow13Present
)
{
this
.
undertowBufferSupport
=
new
Undertow13BufferSupport
();
}
else
{
this
.
undertowBufferSupport
=
new
Undertow10BufferSupport
();
}
this
.
undertowBufferSupport
=
(
undertow13Present
?
new
Undertow13BufferSupport
()
:
new
UndertowXnioBufferSupport
());
}
...
...
@@ -490,6 +486,7 @@ public class UndertowXhrTransport extends AbstractXhrTransport {
}
}
private
interface
UndertowBufferSupport
{
Object
allocatePooledResource
();
...
...
@@ -505,7 +502,8 @@ public class UndertowXhrTransport extends AbstractXhrTransport {
final
XnioWorker
worker
,
OptionMap
options
);
}
private
class
Undertow10BufferSupport
implements
UndertowBufferSupport
{
private
class
UndertowXnioBufferSupport
implements
UndertowBufferSupport
{
private
final
org
.
xnio
.
Pool
<
ByteBuffer
>
xnioBufferPool
;
...
...
@@ -513,7 +511,7 @@ public class UndertowXhrTransport extends AbstractXhrTransport {
private
final
Method
httpClientConnectMethod
;
public
Undertow
10
BufferSupport
()
{
public
Undertow
Xnio
BufferSupport
()
{
this
.
xnioBufferPool
=
new
org
.
xnio
.
ByteBufferSlicePool
(
1048
,
1048
);
this
.
httpClientConnectCallbackMethod
=
ReflectionUtils
.
findMethod
(
UndertowClient
.
class
,
"connect"
,
ClientCallback
.
class
,
URI
.
class
,
XnioWorker
.
class
,
Pool
.
class
,
OptionMap
.
class
);
...
...
@@ -543,7 +541,6 @@ public class UndertowXhrTransport extends AbstractXhrTransport {
XnioWorker
worker
,
OptionMap
options
)
{
ReflectionUtils
.
invokeMethod
(
httpClientConnectCallbackMethod
,
httpClient
,
listener
,
uri
,
worker
,
this
.
xnioBufferPool
,
options
);
}
@Override
...
...
@@ -555,6 +552,7 @@ public class UndertowXhrTransport extends AbstractXhrTransport {
}
}
private
class
Undertow13BufferSupport
implements
UndertowBufferSupport
{
private
final
ByteBufferPool
undertowBufferPool
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录