added "receive-timeout" attribute to "jms:listener-container" element in JMS namespace (SPR-9114)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2012 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.
|
||||
@@ -108,6 +108,7 @@ class JcaListenerContainerParser extends AbstractListenerContainerParser {
|
||||
return containerDef;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean indicatesPubSub(BeanDefinition containerDef) {
|
||||
BeanDefinition configDef =
|
||||
(BeanDefinition) containerDef.getPropertyValues().getPropertyValue("activationSpecConfig").getValue();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2012 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.
|
||||
@@ -47,6 +47,8 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {
|
||||
|
||||
private static final String CACHE_ATTRIBUTE = "cache";
|
||||
|
||||
private static final String RECEIVE_TIMEOUT_ATTRIBUTE = "receive-timeout";
|
||||
|
||||
|
||||
protected BeanDefinition parseContainer(Element listenerEle, Element containerEle, ParserContext parserContext) {
|
||||
RootBeanDefinition containerDef = new RootBeanDefinition();
|
||||
@@ -156,6 +158,13 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {
|
||||
}
|
||||
}
|
||||
|
||||
String receiveTimeout = containerEle.getAttribute(RECEIVE_TIMEOUT_ATTRIBUTE);
|
||||
if (StringUtils.hasText(receiveTimeout)) {
|
||||
if (containerType.startsWith("default")) {
|
||||
containerDef.getPropertyValues().add("receiveTimeout", new Integer(receiveTimeout));
|
||||
}
|
||||
}
|
||||
|
||||
String phase = containerEle.getAttribute(PHASE_ATTRIBUTE);
|
||||
if (StringUtils.hasText(phase)) {
|
||||
containerDef.getPropertyValues().add("phase", phase);
|
||||
@@ -164,10 +173,12 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {
|
||||
return containerDef;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean indicatesPubSub(BeanDefinition containerDef) {
|
||||
return indicatesPubSubConfig(containerDef);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean indicatesJms102(BeanDefinition containerDef) {
|
||||
return containerDef.getBeanClassName().endsWith("102");
|
||||
}
|
||||
|
||||
@@ -233,6 +233,14 @@
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="receive-timeout" type="xsd:int">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The timeout to use for receive calls (in milliseconds).
|
||||
The default is 1000 ms (1 sec); -1 indicates no timeout at all.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="phase" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
|
||||
Reference in New Issue
Block a user