Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
带水的鱼儿
spring-framework
提交
746b1b2f
S
spring-framework
项目概览
带水的鱼儿
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
746b1b2f
编写于
5月 23, 2021
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
ab2c78a9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
64 addition
and
60 deletion
+64
-60
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompClientSupport.java
...ingframework/messaging/simp/stomp/StompClientSupport.java
+2
-2
spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/R2dbcTransactionManager.java
...ngframework/r2dbc/connection/R2dbcTransactionManager.java
+24
-24
spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/SingleConnectionFactory.java
...ngframework/r2dbc/connection/SingleConnectionFactory.java
+32
-28
spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
.../org/springframework/web/bind/annotation/CrossOrigin.java
+2
-2
spring-webmvc/src/main/java/org/springframework/web/servlet/view/groovy/GroovyMarkupViewResolver.java
...ork/web/servlet/view/groovy/GroovyMarkupViewResolver.java
+4
-4
未找到文件。
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompClientSupport.java
浏览文件 @
746b1b2f
/*
* Copyright 2002-20
17
the original author or authors.
* Copyright 2002-20
21
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
*
* <p>Subclasses can connect over WebSocket or TCP using any library. When creating
* a new connection, a subclass can create an instance of {@link DefaultStompSession}
* which
extend
s {@link org.springframework.messaging.tcp.TcpConnectionHandler}
* which
implement
s {@link org.springframework.messaging.tcp.TcpConnectionHandler}
* whose lifecycle methods the subclass must then invoke.
*
* <p>In effect, {@code TcpConnectionHandler} and {@code TcpConnection} are the
...
...
spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/R2dbcTransactionManager.java
浏览文件 @
746b1b2f
/*
* Copyright 2002-202
0
the original author or authors.
* Copyright 2002-202
1
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -39,18 +39,18 @@ import org.springframework.util.Assert;
* {@link org.springframework.transaction.ReactiveTransactionManager}
* implementation for a single R2DBC {@link ConnectionFactory}. This class is
* capable of working in any environment with any R2DBC driver, as long as the
* setup uses a {@
link
ConnectionFactory} as its {@link Connection} factory
* mechanism. Binds a R2DBC {@
link
Connection} from the specified
* {@
link
ConnectionFactory} to the current subscriber context, potentially
* allowing for one context-bound {@
link Connection} per {@link
ConnectionFactory}.
* setup uses a {@
code
ConnectionFactory} as its {@link Connection} factory
* mechanism. Binds a R2DBC {@
code
Connection} from the specified
* {@
code
ConnectionFactory} to the current subscriber context, potentially
* allowing for one context-bound {@
code Connection} per {@code
ConnectionFactory}.
*
* <p><b>Note: The {@
link
ConnectionFactory} that this transaction manager
* operates on needs to return independent {@
link
Connection}s.</b>
* The {@
link
Connection}s may come from a pool (the typical case), but the
* {@
link ConnectionFactory} must not return scoped scoped {@link
Connection}s
* or the like. This transaction manager will associate {@
link
Connection}
* <p><b>Note: The {@
code
ConnectionFactory} that this transaction manager
* operates on needs to return independent {@
code
Connection}s.</b>
* The {@
code
Connection}s may come from a pool (the typical case), but the
* {@
code ConnectionFactory} must not return scoped scoped {@code
Connection}s
* or the like. This transaction manager will associate {@
code
Connection}
* with context-bound transactions itself, according to the specified propagation
* behavior. It assumes that a separate, independent {@
link
Connection} can
* behavior. It assumes that a separate, independent {@
code
Connection} can
* be obtained even during an ongoing transaction.
*
* <p>Application code is required to retrieve the R2DBC Connection via
...
...
@@ -59,18 +59,18 @@ import org.springframework.util.Assert;
* Spring classes such as {@code DatabaseClient} use this strategy implicitly.
* If not used in combination with this transaction manager, the
* {@link ConnectionFactoryUtils} lookup strategy behaves exactly like the
* native {@
link
ConnectionFactory} lookup; it can thus be used in a portable fashion.
* native {@
code
ConnectionFactory} lookup; it can thus be used in a portable fashion.
*
* <p>Alternatively, you can allow application code to work with the standard
* R2DBC lookup pattern {@link ConnectionFactory#create()}, for example for code
* that is not aware of Spring at all. In that case, define a
* {@link TransactionAwareConnectionFactoryProxy} for your target {@
link
ConnectionFactory},
* and pass that proxy {@
link
ConnectionFactory} to your DAOs, which will automatically
* {@link TransactionAwareConnectionFactoryProxy} for your target {@
code
ConnectionFactory},
* and pass that proxy {@
code
ConnectionFactory} to your DAOs, which will automatically
* participate in Spring-managed transactions when accessing it.
*
* <p>This transaction manager triggers flush callbacks on registered transaction
* synchronizations (if synchronization is generally active), assuming resources
* operating on the underlying R2DBC {@
link
Connection}.
* operating on the underlying R2DBC {@
code
Connection}.
*
* @author Mark Paluch
* @since 5.3
...
...
@@ -88,14 +88,14 @@ public class R2dbcTransactionManager extends AbstractReactiveTransactionManager
/**
* Create a new {@
link
R2dbcTransactionManager} instance.
* Create a new {@
code
R2dbcTransactionManager} instance.
* A ConnectionFactory has to be set to be able to use it.
* @see #setConnectionFactory
*/
public
R2dbcTransactionManager
()
{}
/**
* Create a new {@
link
R2dbcTransactionManager} instance.
* Create a new {@
code
R2dbcTransactionManager} instance.
* @param connectionFactory the R2DBC ConnectionFactory to manage transactions for
*/
public
R2dbcTransactionManager
(
ConnectionFactory
connectionFactory
)
{
...
...
@@ -107,10 +107,10 @@ public class R2dbcTransactionManager extends AbstractReactiveTransactionManager
/**
* Set the R2DBC {@link ConnectionFactory} that this instance should manage transactions for.
* <p>This will typically be a locally defined {@
link
ConnectionFactory}, for example an connection pool.
* <p><b>The {@
link
ConnectionFactory} passed in here needs to return independent {@link Connection}s.</b>
* The {@
link Connection}s may come from a pool (the typical case), but the {@link
ConnectionFactory}
* must not return scoped {@
link
Connection}s or the like.
* <p>This will typically be a locally defined {@
code
ConnectionFactory}, for example an connection pool.
* <p><b>The {@
code
ConnectionFactory} passed in here needs to return independent {@link Connection}s.</b>
* The {@
code Connection}s may come from a pool (the typical case), but the {@code
ConnectionFactory}
* must not return scoped {@
code
Connection}s or the like.
* @see TransactionAwareConnectionFactoryProxy
*/
public
void
setConnectionFactory
(
@Nullable
ConnectionFactory
connectionFactory
)
{
...
...
@@ -127,7 +127,7 @@ public class R2dbcTransactionManager extends AbstractReactiveTransactionManager
/**
* Obtain the {@link ConnectionFactory} for actual use.
* @return the {@
link
ConnectionFactory} (never {@code null})
* @return the {@
code
ConnectionFactory} (never {@code null})
* @throws IllegalStateException in case of no ConnectionFactory set
*/
protected
ConnectionFactory
obtainConnectionFactory
()
{
...
...
@@ -405,9 +405,9 @@ public class R2dbcTransactionManager extends AbstractReactiveTransactionManager
}
/**
* Resolve the {@link TransactionDefinition#getIsolationLevel() isolation level constant} to a R2DBC
* Resolve the {@link
plain
TransactionDefinition#getIsolationLevel() isolation level constant} to a R2DBC
* {@link IsolationLevel}. If you'd like to extend isolation level translation for vendor-specific
* {@
link
IsolationLevel}s, override this method accordingly.
* {@
code
IsolationLevel}s, override this method accordingly.
* @param isolationLevel the isolation level to translate.
* @return the resolved isolation level. Can be {@code null} if not resolvable or the isolation level
* should remain {@link TransactionDefinition#ISOLATION_DEFAULT default}.
...
...
spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/SingleConnectionFactory.java
浏览文件 @
746b1b2f
/*
* Copyright 2002-202
0
the original author or authors.
* Copyright 2002-202
1
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -36,25 +36,25 @@ import org.springframework.util.Assert;
/**
* Implementation of {@link DelegatingConnectionFactory} that wraps a
* single R2DBC
Connection
which is not closed after use.
* single R2DBC
{@link Connection}
which is not closed after use.
* Obviously, this is not multi-threading capable.
*
* <p>Note that at shutdown, someone should close the underlying
*
Connection
via the {@code close()} method. Client code will
* never call close on the
Connection
handle if it is
*
{@code Connection}
via the {@code close()} method. Client code will
* never call close on the
{@code Connection}
handle if it is
* SmartConnectionFactory-aware (e.g. uses
* {@link ConnectionFactoryUtils#releaseConnection(Connection, ConnectionFactory)}).
*
* <p>If client code will call {@link Connection#close()} in the
* assumption of a pooled
Connection
, like when using persistence tools,
* set "suppressClose" to
"true"
. This will return a close-suppressing
* assumption of a pooled
{@code Connection}
, like when using persistence tools,
* set "suppressClose" to
{@code true}
. This will return a close-suppressing
* proxy instead of the physical Connection.
*
* <p>This is primarily intended for testing and pipelining usage of connections.
* For example, it enables easy testing outside an application server
,
for code
* For example, it enables easy testing outside an application server for code
* that expects to work on a {@link ConnectionFactory}.
* Note that this implementation does not act as a connection pool-like utility.
* Connection pooling requires a
{@link ConnectionFactory} implemented by e.g.
* Connection pooling requires a
pooling {@link ConnectionFactory} such as one from
* {@code r2dbc-pool}.
*
* @author Mark Paluch
...
...
@@ -90,10 +90,10 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory
}
/**
* Create a new {@
link SingleConnectionFactory} using a
R2DBC connection URL.
* @param url the R2DBC URL to use for accessing {@link ConnectionFactory} discovery
.
* @param suppressClose if the returned {@link Connection} should be a
close-suppressing proxy
*
or the physical {@link Connection}.
* Create a new {@
code SingleConnectionFactory} using an
R2DBC connection URL.
* @param url the R2DBC URL to use for accessing {@link ConnectionFactory} discovery
* @param suppressClose if the returned {@link Connection} should be a
*
close-suppressing proxy or the physical {@code Connection}
* @see ConnectionFactories#get(String)
*/
public
SingleConnectionFactory
(
String
url
,
boolean
suppressClose
)
{
...
...
@@ -103,13 +103,15 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory
}
/**
* Create a new {@link SingleConnectionFactory} with a given {@link Connection} and
* {@link ConnectionFactoryMetadata}.
* @param target underlying target {@link Connection}.
* @param metadata {@link ConnectionFactory} metadata to be associated with this {@link ConnectionFactory}.
* @param suppressClose if the {@link Connection} should be wrapped with a {@link Connection} that suppresses
* {@code close()} calls (to allow for normal {@code close()} usage in applications that expect a pooled
* {@link Connection}).
* Create a new {@code SingleConnectionFactory} with a given {@link Connection}
* and {@link ConnectionFactoryMetadata}.
* @param target underlying target {@code Connection}
* @param metadata {@code ConnectionFactory} metadata to be associated with
* this {@code ConnectionFactory}
* @param suppressClose {@code true} if the {@code Connection} should be wrapped
* with a {@code Connection} that suppresses {@code close()} calls (to allow
* for normal {@code close()} usage in applications that expect a pooled
* {@code Connection})
*/
public
SingleConnectionFactory
(
Connection
target
,
ConnectionFactoryMetadata
metadata
,
boolean
suppressClose
)
{
super
(
new
ConnectionFactory
()
{
...
...
@@ -133,7 +135,7 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory
/**
* Set whether the returned {@link Connection} should be a close-suppressing proxy
* or the physical {@
link
Connection}.
* or the physical {@
code
Connection}.
*/
public
void
setSuppressClose
(
boolean
suppressClose
)
{
this
.
suppressClose
=
suppressClose
;
...
...
@@ -141,21 +143,23 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory
/**
* Return whether the returned {@link Connection} will be a close-suppressing proxy
* or the physical {@
link
Connection}.
* or the physical {@
code
Connection}.
*/
protected
boolean
isSuppressClose
()
{
return
this
.
suppressClose
;
}
/**
* Set whether the returned {@link Connection}'s "autoCommit" setting should be overridden.
* Set whether the returned {@link Connection}'s "autoCommit" setting should
* be overridden.
*/
public
void
setAutoCommit
(
boolean
autoCommit
)
{
this
.
autoCommit
=
autoCommit
;
}
/**
* Return whether the returned {@link Connection}'s "autoCommit" setting should be overridden.
* Return whether the returned {@link Connection}'s "autoCommit" setting should
* be overridden.
* @return the "autoCommit" value, or {@code null} if none to be applied
*/
@Nullable
...
...
@@ -207,9 +211,9 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory
/**
* Prepare the {@link Connection} before using it.
* Applies {@link #getAutoCommitValue() auto-commit} settings if configured.
* @param connection the requested {@
link Connection}.
* @return the prepared {@
link Connection}.
* Applies {@link
plain
#getAutoCommitValue() auto-commit} settings if configured.
* @param connection the requested {@
code Connection}
* @return the prepared {@
code Connection}
*/
protected
Mono
<
Connection
>
prepareConnection
(
Connection
connection
)
{
Boolean
autoCommit
=
getAutoCommitValue
();
...
...
@@ -222,8 +226,8 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory
/**
* Wrap the given {@link Connection} with a proxy that delegates every method call to it
* but suppresses close calls.
* @param target the original {@
link Connection} to wrap.
* @return the wrapped Connection
.
* @param target the original {@
code Connection} to wrap
* @return the wrapped Connection
*/
protected
Connection
getCloseSuppressingConnectionProxy
(
Connection
target
)
{
return
(
Connection
)
Proxy
.
newProxyInstance
(
SingleConnectionFactory
.
class
.
getClassLoader
(),
...
...
spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
浏览文件 @
746b1b2f
...
...
@@ -80,14 +80,14 @@ public @interface CrossOrigin {
/**
* A list of origins for which cross-origin requests are allowed. Please,
* see {@link CorsConfiguration#setAllowedOrigins(List)} for details.
* <p>By default all origins are allowed unless {@
code
originPatterns} is
* <p>By default all origins are allowed unless {@
link #
originPatterns} is
* also set in which case {@code originPatterns} is used instead.
*/
@AliasFor
(
"value"
)
String
[]
origins
()
default
{};
/**
* Alternative to {@link #origins
()} that supports more flexible origins
* Alternative to {@link #origins
} that supports more flexible origin
* patterns. Please, see {@link CorsConfiguration#setAllowedOriginPatterns(List)}
* for details.
* <p>By default this is not set.
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/view/groovy/GroovyMarkupViewResolver.java
浏览文件 @
746b1b2f
/*
* Copyright 2002-202
0
the original author or authors.
* Copyright 2002-202
1
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -27,11 +27,11 @@ import org.springframework.web.servlet.view.AbstractUrlBasedView;
* custom subclasses of it.
*
* <p>The view class for all views created by this resolver can be specified
* via
the {@link #setViewClass(Class)} property
.
* via
{@link #setViewClass(Class)}
.
*
* <p><b>Note:</b> When chaining ViewResolvers this resolver will check for the
* existence of the specified template resources and only return a non-null
*
View
object if a template is actually found.
*
{@code View}
object if a template is actually found.
*
* @author Brian Clozel
* @since 4.1
...
...
@@ -48,7 +48,7 @@ public class GroovyMarkupViewResolver extends AbstractTemplateViewResolver {
}
/**
* A convenience constructor that allows for specifying {@link #setPrefix prefix}
* A convenience constructor that allows for specifying
the
{@link #setPrefix prefix}
* and {@link #setSuffix suffix} as constructor arguments.
* @param prefix the prefix that gets prepended to view names when building a URL
* @param suffix the suffix that gets appended to view names when building a URL
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录