You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bv...@apache.org on 2013/02/01 11:04:19 UTC

svn commit: r1441366 - in /camel/branches/camel-2.10.x: ./ components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ components/camel-jms/src/test/java/org/apache/camel/component/jms/ platforms/karaf/commands/src/main/java/org/apache/cam...

Author: bvahdat
Date: Fri Feb  1 10:04:19 2013
New Revision: 1441366

URL: http://svn.apache.org/viewvc?rev=1441366&view=rev
Log:
Merged revisions 1437208 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1437208 | bvahdat | 2013-01-22 22:57:29 +0100 (Di, 22 Jan 2013) | 1 line
  
  Fixed CS and removed some obsolete code from the camel-jms test code.
........

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
    camel/branches/camel-2.10.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyTempQueueMultipleConsumersTest.java
    camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java
    camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextList.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1437208

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java?rev=1441366&r1=1441365&r2=1441366&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java (original)
+++ camel/branches/camel-2.10.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java Fri Feb  1 10:04:19 2013
@@ -183,8 +183,8 @@ public class TemporaryQueueReplyManager 
         @Override
         public void onException(JMSException exception) {
             // capture exceptions, and schedule a refresh of the ReplyTo destination
-            log.warn("Exception inside the DMLC for Temporary ReplyTo Queue for destination " + endpoint.getDestinationName() +
-            		", refreshing ReplyTo destination", exception);
+            log.warn("Exception inside the DMLC for Temporary ReplyTo Queue for destination " + endpoint.getDestinationName()
+                     + ", refreshing ReplyTo destination", exception);
             destResolver.scheduleRefresh();
             // serve as a proxy for any exception listener the user may have set explicitly
             if (delegate != null) {
@@ -198,8 +198,7 @@ public class TemporaryQueueReplyManager 
         private TemporaryQueue queue;
         private AtomicBoolean refreshWanted = new AtomicBoolean(false);
 
-        public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) 
-                throws JMSException {
+        public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException {
             // use a temporary queue to gather the reply message
             synchronized (refreshWanted) {
                 if (queue == null || refreshWanted.compareAndSet(true, false)) {

Modified: camel/branches/camel-2.10.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyTempQueueMultipleConsumersTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyTempQueueMultipleConsumersTest.java?rev=1441366&r1=1441365&r2=1441366&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyTempQueueMultipleConsumersTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyTempQueueMultipleConsumersTest.java Fri Feb  1 10:04:19 2013
@@ -23,11 +23,6 @@ import java.util.concurrent.ExecutorServ
 import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import javax.jms.ConnectionFactory;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.TransportConnection;
 import org.apache.activemq.pool.PooledConnectionFactory;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
@@ -45,7 +40,6 @@ import static org.apache.camel.component
 public class JmsRequestReplyTempQueueMultipleConsumersTest extends CamelTestSupport {
 
     private Map<String, AtomicInteger> msgsPerThread = new ConcurrentHashMap<String, AtomicInteger>();
-    private BrokerService broker;
     private PooledConnectionFactory connectionFactory;
     
     @Test
@@ -90,20 +84,8 @@ public class JmsRequestReplyTempQueueMul
         executor.shutdownNow();
     }
     
-    public void startBroker() throws Exception {
-        String brokerName = "test-broker-" + System.currentTimeMillis();
-        String brokerUri = "vm://" + brokerName;
-        broker = new BrokerService();
-        broker.setBrokerName(brokerName);
-        broker.setBrokerId(brokerName);
-        broker.addConnector(brokerUri);
-        broker.setPersistent(false);
-        broker.start();
-    }
-
     protected CamelContext createCamelContext() throws Exception {
         CamelContext camelContext = super.createCamelContext();
-        //startBroker();
         
         connectionFactory = (PooledConnectionFactory) CamelJmsTestHelper.createConnectionFactory();
         camelContext.addComponent("jms", jmsComponentAutoAcknowledge(connectionFactory));
@@ -116,26 +98,22 @@ public class JmsRequestReplyTempQueueMul
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("seda:start")
-                    .inOut("jms:queue:foo?concurrentConsumers=10&maxConcurrentConsumers=20&recoveryInterval=10")
-                    .process(new Processor() {
-                        @Override
-                        public void process(Exchange exchange) throws Exception {
-                            String threadName = Thread.currentThread().getName();
-                            synchronized (msgsPerThread) {
-                               AtomicInteger count = msgsPerThread.get(threadName);
-                               if (count == null) {
-                                   count = new AtomicInteger(0);
-                                   msgsPerThread.put(threadName, count);
-                               }
-                               count.incrementAndGet();
+                from("seda:start").inOut("jms:queue:foo?concurrentConsumers=10&maxConcurrentConsumers=20&recoveryInterval=10").process(new Processor() {
+                    @Override
+                    public void process(Exchange exchange) throws Exception {
+                        String threadName = Thread.currentThread().getName();
+                        synchronized (msgsPerThread) {
+                            AtomicInteger count = msgsPerThread.get(threadName);
+                            if (count == null) {
+                                count = new AtomicInteger(0);
+                                msgsPerThread.put(threadName, count);
                             }
+                            count.incrementAndGet();
                         }
-                    })
-                    .to("mock:result");
+                    }
+                }).to("mock:result");
 
-                from("jms:queue:foo?concurrentConsumers=20&recoveryInterval=10")
-                    .setBody(simple("Reply >>> ${body}"));
+                from("jms:queue:foo?concurrentConsumers=20&recoveryInterval=10").setBody(simple("Reply >>> ${body}"));
             }
         };
     }

Modified: camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java?rev=1441366&r1=1441365&r2=1441366&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java (original)
+++ camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java Fri Feb  1 10:04:19 2013
@@ -86,7 +86,7 @@ public class ContextInfo extends OsgiCom
                 System.out.println(StringEscapeUtils.unescapeJava("\tExchanges Failed: " + exchangesFailed));
                 Long minProcessingTime = (Long) mBeanServer.getAttribute(contextMBean, "MinProcessingTime");
                 System.out.println(StringEscapeUtils.unescapeJava("\tMin Processing Time: " + minProcessingTime + "ms"));
-                Long maxProcessingTime = (Long) mBeanServer.getAttribute(contextMBean,  "MaxProcessingTime");
+                Long maxProcessingTime = (Long) mBeanServer.getAttribute(contextMBean, "MaxProcessingTime");
                 System.out.println(StringEscapeUtils.unescapeJava("\tMax Processing Time: " + maxProcessingTime + "ms"));
                 Long meanProcessingTime = (Long) mBeanServer.getAttribute(contextMBean, "MeanProcessingTime");
                 System.out.println(StringEscapeUtils.unescapeJava("\tMean Processing Time: " + meanProcessingTime + "ms"));
@@ -173,7 +173,7 @@ public class ContextInfo extends OsgiCom
         for (String language : camelContext.getLanguageNames()) {
             System.out.println(StringEscapeUtils.unescapeJava("\t" + language));
         }
-        
+
         return null;
     }
 

Modified: camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextList.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextList.java?rev=1441366&r1=1441365&r2=1441366&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextList.java (original)
+++ camel/branches/camel-2.10.x/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextList.java Fri Feb  1 10:04:19 2013
@@ -34,7 +34,7 @@ public class ContextList extends OsgiCom
     private static final String NAME_COLUMN_LABEL = "Name";
     private static final String STATUS_COLUMN_LABEL = "Status";
     private static final String UPTIME_COLUMN_LABEL = "Uptime";
-    private static final int DEFAULT_FORMAT_BUFFER_LENGTH = 24; 
+    private static final int DEFAULT_FORMAT_BUFFER_LENGTH = 24;
     private static final String DEFAULT_FIELD_PREAMBLE = "[ ";
     private static final String DEFAULT_FIELD_POSTAMBLE = " ]";
     private static final String DEFAULT_HEADER_PREAMBLE = "  ";
@@ -51,7 +51,7 @@ public class ContextList extends OsgiCom
     protected Object doExecute() throws Exception {
         final List<CamelContext> camelContexts = camelController.getCamelContexts();
 
-        final Map<String, Integer> columnWidths = computeColumnWidths(camelContexts); 
+        final Map<String, Integer> columnWidths = computeColumnWidths(camelContexts);
         final String headerFormat = buildFormatString(columnWidths, true);
         final String rowFormat = buildFormatString(columnWidths, false);
         final PrintStream out = System.out;
@@ -77,10 +77,10 @@ public class ContextList extends OsgiCom
             for (final CamelContext camelContext : camelContexts) {
                 final String name = camelContext.getName();
                 maxNameLen = java.lang.Math.max(maxNameLen, name == null ? 0 : name.length());
-             
+
                 final String status = camelContext.getStatus().toString();
                 maxStatusLen = java.lang.Math.max(maxStatusLen, status == null ? 0 : status.length());
-             
+
                 final String uptime = camelContext.getUptime();
                 maxUptimeLen = java.lang.Math.max(maxUptimeLen, uptime == null ? 0 : uptime.length());
             }
@@ -99,7 +99,7 @@ public class ContextList extends OsgiCom
         final String fieldPostamble;
         final int columnWidthIncrement;
 
-        if (isHeader) { 
+        if (isHeader) {
             fieldPreamble = DEFAULT_HEADER_PREAMBLE;
             fieldPostamble = DEFAULT_HEADER_POSTAMBLE;
         } else {
@@ -107,7 +107,7 @@ public class ContextList extends OsgiCom
             fieldPostamble = DEFAULT_FIELD_POSTAMBLE;
         }
         columnWidthIncrement = DEFAULT_COLUMN_WIDTH_INCREMENT;
-        
+
         final int nameLen = java.lang.Math.min(columnWidths.get(NAME_COLUMN_LABEL) + columnWidthIncrement, MAX_COLUMN_WIDTH);
         final int statusLen = java.lang.Math.min(columnWidths.get(STATUS_COLUMN_LABEL) + columnWidthIncrement, MAX_COLUMN_WIDTH);
         final int uptimeLen = java.lang.Math.min(columnWidths.get(UPTIME_COLUMN_LABEL) + columnWidthIncrement, MAX_COLUMN_WIDTH);