Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
a9ae2c34
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
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,发现更多精彩内容 >>
提交
a9ae2c34
编写于
1月 23, 2017
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
e566e25b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
36 deletion
+37
-36
spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCache.java
.../springframework/cache/concurrent/ConcurrentMapCache.java
+6
-7
spring-jms/src/main/java/org/springframework/jms/config/AbstractJmsListenerEndpoint.java
...ringframework/jms/config/AbstractJmsListenerEndpoint.java
+5
-3
spring-jms/src/main/java/org/springframework/jms/config/JmsListenerEndpointRegistrar.java
...ingframework/jms/config/JmsListenerEndpointRegistrar.java
+2
-3
spring-jms/src/main/java/org/springframework/jms/config/MethodJmsListenerEndpoint.java
...springframework/jms/config/MethodJmsListenerEndpoint.java
+2
-5
spring-jms/src/main/java/org/springframework/jms/core/BrowserCallback.java
...in/java/org/springframework/jms/core/BrowserCallback.java
+8
-6
spring-jms/src/main/java/org/springframework/jms/core/ProducerCallback.java
...n/java/org/springframework/jms/core/ProducerCallback.java
+6
-4
spring-jms/src/main/java/org/springframework/jms/core/SessionCallback.java
...in/java/org/springframework/jms/core/SessionCallback.java
+8
-8
未找到文件。
spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCache.java
浏览文件 @
a9ae2c34
/*
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -180,9 +180,9 @@ public class ConcurrentMapCache extends AbstractValueAdaptingCache {
...
@@ -180,9 +180,9 @@ public class ConcurrentMapCache extends AbstractValueAdaptingCache {
try
{
try
{
return
serializeValue
(
storeValue
);
return
serializeValue
(
storeValue
);
}
}
catch
(
Exception
ex
)
{
catch
(
Throwable
ex
)
{
throw
new
IllegalArgumentException
(
"Failed to serialize cache value '"
throw
new
IllegalArgumentException
(
"Failed to serialize cache value '"
+
userValue
+
+
userValue
+
"'. Does it implement Serializable?"
,
ex
);
"'. Does it implement Serializable?"
,
ex
);
}
}
}
}
else
{
else
{
...
@@ -207,9 +207,8 @@ public class ConcurrentMapCache extends AbstractValueAdaptingCache {
...
@@ -207,9 +207,8 @@ public class ConcurrentMapCache extends AbstractValueAdaptingCache {
try
{
try
{
return
super
.
fromStoreValue
(
deserializeValue
(
storeValue
));
return
super
.
fromStoreValue
(
deserializeValue
(
storeValue
));
}
}
catch
(
Exception
ex
)
{
catch
(
Throwable
ex
)
{
throw
new
IllegalArgumentException
(
"Failed to deserialize cache value '"
+
throw
new
IllegalArgumentException
(
"Failed to deserialize cache value '"
+
storeValue
+
"'"
,
ex
);
storeValue
+
"'"
,
ex
);
}
}
}
}
else
{
else
{
...
...
spring-jms/src/main/java/org/springframework/jms/config/AbstractJmsListenerEndpoint.java
浏览文件 @
a9ae2c34
/*
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -22,12 +22,12 @@ import org.springframework.jms.listener.AbstractMessageListenerContainer;
...
@@ -22,12 +22,12 @@ import org.springframework.jms.listener.AbstractMessageListenerContainer;
import
org.springframework.jms.listener.MessageListenerContainer
;
import
org.springframework.jms.listener.MessageListenerContainer
;
import
org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
;
import
org.springframework.jms.listener.endpoint.JmsActivationSpecConfig
;
import
org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
;
import
org.springframework.jms.listener.endpoint.JmsMessageEndpointManager
;
import
org.springframework.util.Assert
;
/**
/**
* Base model for a JMS listener endpoint
* Base model for a JMS listener endpoint
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
* @author Juergen Hoeller
* @since 4.1
* @since 4.1
* @see MethodJmsListenerEndpoint
* @see MethodJmsListenerEndpoint
* @see SimpleJmsListenerEndpoint
* @see SimpleJmsListenerEndpoint
...
@@ -150,7 +150,9 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
...
@@ -150,7 +150,9 @@ public abstract class AbstractJmsListenerEndpoint implements JmsListenerEndpoint
private
void
setupMessageListener
(
MessageListenerContainer
container
)
{
private
void
setupMessageListener
(
MessageListenerContainer
container
)
{
MessageListener
messageListener
=
createMessageListener
(
container
);
MessageListener
messageListener
=
createMessageListener
(
container
);
Assert
.
state
(
messageListener
!=
null
,
"Endpoint ["
+
this
+
"] must provide a non null message listener"
);
if
(
messageListener
==
null
)
{
throw
new
IllegalStateException
(
"Endpoint ["
+
this
+
"] must provide a non-null message listener"
);
}
container
.
setupMessageListener
(
messageListener
);
container
.
setupMessageListener
(
messageListener
);
}
}
...
...
spring-jms/src/main/java/org/springframework/jms/config/JmsListenerEndpointRegistrar.java
浏览文件 @
a9ae2c34
/*
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -117,8 +117,7 @@ public class JmsListenerEndpointRegistrar implements BeanFactoryAware, Initializ
...
@@ -117,8 +117,7 @@ public class JmsListenerEndpointRegistrar implements BeanFactoryAware, Initializ
public
void
setBeanFactory
(
BeanFactory
beanFactory
)
{
public
void
setBeanFactory
(
BeanFactory
beanFactory
)
{
this
.
beanFactory
=
beanFactory
;
this
.
beanFactory
=
beanFactory
;
if
(
beanFactory
instanceof
ConfigurableBeanFactory
)
{
if
(
beanFactory
instanceof
ConfigurableBeanFactory
)
{
ConfigurableBeanFactory
cbf
=
(
ConfigurableBeanFactory
)
beanFactory
;
this
.
mutex
=
((
ConfigurableBeanFactory
)
beanFactory
).
getSingletonMutex
();
this
.
mutex
=
cbf
.
getSingletonMutex
();
}
}
}
}
...
...
spring-jms/src/main/java/org/springframework/jms/config/MethodJmsListenerEndpoint.java
浏览文件 @
a9ae2c34
/*
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -57,8 +57,6 @@ public class MethodJmsListenerEndpoint extends AbstractJmsListenerEndpoint imple
...
@@ -57,8 +57,6 @@ public class MethodJmsListenerEndpoint extends AbstractJmsListenerEndpoint imple
private
StringValueResolver
embeddedValueResolver
;
private
StringValueResolver
embeddedValueResolver
;
private
BeanFactory
beanFactory
;
/**
/**
* Set the actual bean instance to invoke this endpoint method on.
* Set the actual bean instance to invoke this endpoint method on.
...
@@ -122,11 +120,10 @@ public class MethodJmsListenerEndpoint extends AbstractJmsListenerEndpoint imple
...
@@ -122,11 +120,10 @@ public class MethodJmsListenerEndpoint extends AbstractJmsListenerEndpoint imple
}
}
/**
/**
* Set the {@link BeanFactory} to use to resolve expressions (
can
be {@code null}).
* Set the {@link BeanFactory} to use to resolve expressions (
may
be {@code null}).
*/
*/
@Override
@Override
public
void
setBeanFactory
(
BeanFactory
beanFactory
)
{
public
void
setBeanFactory
(
BeanFactory
beanFactory
)
{
this
.
beanFactory
=
beanFactory
;
if
(
this
.
embeddedValueResolver
==
null
&&
beanFactory
instanceof
ConfigurableBeanFactory
)
{
if
(
this
.
embeddedValueResolver
==
null
&&
beanFactory
instanceof
ConfigurableBeanFactory
)
{
this
.
embeddedValueResolver
=
new
EmbeddedValueResolver
((
ConfigurableBeanFactory
)
beanFactory
);
this
.
embeddedValueResolver
=
new
EmbeddedValueResolver
((
ConfigurableBeanFactory
)
beanFactory
);
}
}
...
...
spring-jms/src/main/java/org/springframework/jms/core/BrowserCallback.java
浏览文件 @
a9ae2c34
/*
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -23,8 +23,9 @@ import javax.jms.Session;
...
@@ -23,8 +23,9 @@ import javax.jms.Session;
/**
/**
* Callback for browsing the messages in a JMS queue.
* Callback for browsing the messages in a JMS queue.
*
*
* <p>To be used with JmsTemplate's callback methods that take a BrowserCallback
* <p>To be used with {@link JmsTemplate}'s callback methods that take a
* argument, often implemented as an anonymous inner class.
* {@link BrowserCallback} argument, often implemented as an anonymous
* inner class or as a lambda expression.
*
*
* @author Juergen Hoeller
* @author Juergen Hoeller
* @since 2.5.1
* @since 2.5.1
...
@@ -35,11 +36,12 @@ import javax.jms.Session;
...
@@ -35,11 +36,12 @@ import javax.jms.Session;
public
interface
BrowserCallback
<
T
>
{
public
interface
BrowserCallback
<
T
>
{
/**
/**
* Perform operations on the given {@link javax.jms.Session} and
{@link javax.jms.QueueBrowser}.
* Perform operations on the given {@link javax.jms.Session} and
*
<p>The message producer is not associated with any destination
.
*
{@link javax.jms.QueueBrowser}
.
* @param session the JMS {@code Session} object to use
* @param session the JMS {@code Session} object to use
* @param browser the JMS {@code QueueBrowser} object to use
* @param browser the JMS {@code QueueBrowser} object to use
* @return a result object from working with the {@code Session}, if any (can be {@code null})
* @return a result object from working with the {@code Session}, if any
* (or {@code null} if none)
* @throws javax.jms.JMSException if thrown by JMS API methods
* @throws javax.jms.JMSException if thrown by JMS API methods
*/
*/
T
doInJms
(
Session
session
,
QueueBrowser
browser
)
throws
JMSException
;
T
doInJms
(
Session
session
,
QueueBrowser
browser
)
throws
JMSException
;
...
...
spring-jms/src/main/java/org/springframework/jms/core/ProducerCallback.java
浏览文件 @
a9ae2c34
/*
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -23,8 +23,9 @@ import javax.jms.Session;
...
@@ -23,8 +23,9 @@ import javax.jms.Session;
/**
/**
* Callback for sending a message to a JMS destination.
* Callback for sending a message to a JMS destination.
*
*
* <p>To be used with JmsTemplate's callback methods that take a ProducerCallback
* <p>To be used with {@link JmsTemplate}'s callback methods that take a
* argument, often implemented as an anonymous inner class.
* {@link ProducerCallback} argument, often implemented as an anonymous
* inner class or as a lambda expression.
*
*
* <p>The typical implementation will perform multiple operations on the
* <p>The typical implementation will perform multiple operations on the
* supplied JMS {@link Session} and {@link MessageProducer}.
* supplied JMS {@link Session} and {@link MessageProducer}.
...
@@ -44,7 +45,8 @@ public interface ProducerCallback<T> {
...
@@ -44,7 +45,8 @@ public interface ProducerCallback<T> {
* when specified in the JmsTemplate call.
* when specified in the JmsTemplate call.
* @param session the JMS {@code Session} object to use
* @param session the JMS {@code Session} object to use
* @param producer the JMS {@code MessageProducer} object to use
* @param producer the JMS {@code MessageProducer} object to use
* @return a result object from working with the {@code Session}, if any (can be {@code null})
* @return a result object from working with the {@code Session}, if any
* (or {@code null} if none)
* @throws javax.jms.JMSException if thrown by JMS API methods
* @throws javax.jms.JMSException if thrown by JMS API methods
*/
*/
T
doInJms
(
Session
session
,
MessageProducer
producer
)
throws
JMSException
;
T
doInJms
(
Session
session
,
MessageProducer
producer
)
throws
JMSException
;
...
...
spring-jms/src/main/java/org/springframework/jms/core/SessionCallback.java
浏览文件 @
a9ae2c34
/*
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -20,11 +20,10 @@ import javax.jms.JMSException;
...
@@ -20,11 +20,10 @@ import javax.jms.JMSException;
import
javax.jms.Session
;
import
javax.jms.Session
;
/**
/**
* Callback for executing any number of operations on a provided
* Callback for executing any number of operations on a provided {@link Session}.
* {@link Session}.
*
*
* <p>To be used with the {@link JmsTemplate#execute(SessionCallback)}
* <p>To be used with the {@link JmsTemplate#execute(SessionCallback)}
method,
*
method, often implemented as an anonymous inner class
.
*
often implemented as an anonymous inner class or as a lambda expression
.
*
*
* @author Mark Pollack
* @author Mark Pollack
* @since 1.1
* @since 1.1
...
@@ -34,10 +33,11 @@ import javax.jms.Session;
...
@@ -34,10 +33,11 @@ import javax.jms.Session;
public
interface
SessionCallback
<
T
>
{
public
interface
SessionCallback
<
T
>
{
/**
/**
* Execute any number of operations against the supplied JMS
* Execute any number of operations against the supplied JMS
{@link Session},
*
{@link Session},
possibly returning a result.
* possibly returning a result.
* @param session the JMS {@code Session}
* @param session the JMS {@code Session}
* @return a result object from working with the {@code Session}, if any (so can be {@code null})
* @return a result object from working with the {@code Session}, if any
* (or {@code null} if none)
* @throws javax.jms.JMSException if thrown by JMS API methods
* @throws javax.jms.JMSException if thrown by JMS API methods
*/
*/
T
doInJms
(
Session
session
)
throws
JMSException
;
T
doInJms
(
Session
session
)
throws
JMSException
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录