Author: sergeyb
Date: Wed May 6 11:57:36 2009
New Revision: 772161
URL: http://svn.apache.org/viewvc?rev=772161&view=rev
Log:
Merged revisions 772143 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r772143 | sergeyb | 2009-05-06 12:03:32 +0100 (Wed, 06 May 2009) | 1 line
CXF-2002 : applying a patch on behalf of Freeman
........
Modified:
cxf/branches/2.1.x-fixes/ (props changed)
cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 6 11:57:36 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,772143
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=772161&r1=772160&r2=772161&view=diff
==============================================================================
---
cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
(original)
+++
cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
Wed May 6 11:57:36 2009
@@ -29,7 +29,6 @@
import javax.naming.NamingException;
import org.apache.cxf.common.logging.LogUtils;
-import org.springframework.core.task.SimpleAsyncTaskExecutor;
import
org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.JmsTemplate102;
@@ -166,11 +165,8 @@
}
if (jmsConfig.getTaskExecutor() != null) {
jmsListener.setTaskExecutor(jmsConfig.getTaskExecutor());
- } else {
- SimpleAsyncTaskExecutor taskExecutor = new
SimpleAsyncTaskExecutor();
-
taskExecutor.setConcurrencyLimit(jmsConfig.getMaxConcurrentTasks());
- jmsListener.setTaskExecutor(taskExecutor);
- }
+ }
+
if (jmsConfig.isAutoResolveDestination()) {
jmsListener.setDestinationName(destinationName);
} else {
Modified:
cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java?rev=772161&r1=772160&r2=772161&view=diff
==============================================================================
---
cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
(original)
+++
cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
Wed May 6 11:57:36 2009
@@ -22,11 +22,9 @@
import java.util.Collection;
import java.util.Timer;
import java.util.TimerTask;
-import java.util.logging.Logger;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
-import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.continuations.Continuation;
import org.apache.cxf.continuations.SuspendedInvocationException;
import org.apache.cxf.message.Message;
@@ -36,8 +34,7 @@
public class JMSContinuation implements Continuation {
- static final String BOGUS_MESSAGE_SELECTOR =
"org.apache.cxf.transports.jms.continuations=too-many";
- private static final Logger LOG =
LogUtils.getL7dLogger(JMSContinuation.class);
+ static final String BOGUS_MESSAGE_SELECTOR =
"orgApacheCxfTransportsJmsContinuations='too-many'";
private Bus bus;
private Message inMessage;
@@ -153,28 +150,24 @@
protected void updateContinuations(boolean remove) {
- modifyList(remove);
-
if (jmsConfig.getMaxSuspendedContinuations() < 0
|| jmsListener.getCacheLevel() >=
DefaultMessageListenerContainer.CACHE_CONSUMER) {
+ modifyList(remove);
return;
}
// throttle the flow if there're too many continuation instances in
memory
- if (remove && !BOGUS_MESSAGE_SELECTOR.equals(currentMessageSelector)) {
- LOG.fine("A number of continuations has dropped below the limit of
"
- + jmsConfig.getMaxSuspendedContinuations()
- + ", resetting JMS MessageSelector to " +
currentMessageSelector);
- jmsListener.setMessageSelector(currentMessageSelector);
- currentMessageSelector = BOGUS_MESSAGE_SELECTOR;
- } else if (!remove && continuations.size() >=
jmsConfig.getMaxSuspendedContinuations()) {
- currentMessageSelector = jmsListener.getMessageSelector();
- if (!BOGUS_MESSAGE_SELECTOR.equals(currentMessageSelector)) {
- LOG.fine("A number of continuations has reached the limit of "
- + jmsConfig.getMaxSuspendedContinuations()
- + ", setting JMS MessageSelector to " +
BOGUS_MESSAGE_SELECTOR);
- jmsListener.setMessageSelector(BOGUS_MESSAGE_SELECTOR);
-
+ synchronized (continuations) {
+ modifyList(remove);
+ if (remove &&
!BOGUS_MESSAGE_SELECTOR.equals(currentMessageSelector)) {
+ jmsListener.setMessageSelector(currentMessageSelector);
+ currentMessageSelector = BOGUS_MESSAGE_SELECTOR;
+ } else if (!remove && continuations.size() >=
jmsConfig.getMaxSuspendedContinuations()) {
+ currentMessageSelector = jmsListener.getMessageSelector();
+ if (!BOGUS_MESSAGE_SELECTOR.equals(currentMessageSelector)) {
+ jmsListener.setMessageSelector(BOGUS_MESSAGE_SELECTOR);
+
+ }
}
}