camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] camel git commit: CAMEL-8059: Fixed CS
Date Tue, 18 Nov 2014 14:43:19 GMT
CAMEL-8059: Fixed CS


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c03a34f6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c03a34f6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c03a34f6

Branch: refs/heads/master
Commit: c03a34f6fb9296be62534bf97921833a34704aea
Parents: c9a562e
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Nov 18 15:43:04 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Nov 18 15:43:04 2014 +0100

----------------------------------------------------------------------
 .../camel/impl/CamelContextTrackerRegistry.java | 21 +++++++++---------
 .../apache/camel/impl/DefaultCamelContext.java  |  4 ++--
 .../apache/camel/spi/CamelContextTracker.java   |  8 +++----
 .../camel/impl/CamelContextTrackerTest.java     | 23 ++++++++++----------
 4 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c03a34f6/camel-core/src/main/java/org/apache/camel/impl/CamelContextTrackerRegistry.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/CamelContextTrackerRegistry.java
b/camel-core/src/main/java/org/apache/camel/impl/CamelContextTrackerRegistry.java
index 3ec2252..bd70e56 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/CamelContextTrackerRegistry.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/CamelContextTrackerRegistry.java
@@ -16,7 +16,7 @@
  */
 package org.apache.camel.impl;
 
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Set;
 
 import org.apache.camel.CamelContext;
@@ -25,22 +25,23 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
+ * A registry for {@link CamelContextTracker}.
  */
 public final class CamelContextTrackerRegistry {
 
-    private static final Logger LOG = LoggerFactory.getLogger(CamelContextTrackerRegistry.class);
-
     /**
      * The registry singleton
      */
     public static final CamelContextTrackerRegistry INSTANCE = new CamelContextTrackerRegistry();
-    
-    private final Set<CamelContextTracker> trackers = new HashSet<CamelContextTracker>();
 
-    // Hide ctor
+    private static final Logger LOG = LoggerFactory.getLogger(CamelContextTrackerRegistry.class);
+
+    private final Set<CamelContextTracker> trackers = new LinkedHashSet<CamelContextTracker>();
+
     private CamelContextTrackerRegistry() {
+        // hide constructor
     }
-    
+
     public synchronized void addTracker(CamelContextTracker tracker) {
         trackers.add(tracker);
     }
@@ -52,9 +53,9 @@ public final class CamelContextTrackerRegistry {
     synchronized void contextCreated(CamelContext camelContext) {
         for (CamelContextTracker tracker : trackers) {
             try {
-            	tracker.contextCreated(camelContext);
-            } catch (Exception ex) {
-                LOG.warn("Error calling context tracker. This exception is ignored.", ex);
+                tracker.contextCreated(camelContext);
+            } catch (Exception e) {
+                LOG.warn("Error calling CamelContext tracker. This exception is ignored.",
e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/c03a34f6/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 5d646da..deba649 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.impl;
 
-import static org.apache.camel.util.StringQuoteHelper.doubleQuote;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
@@ -150,6 +148,8 @@ import org.apache.camel.util.URISupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.camel.util.StringQuoteHelper.doubleQuote;
+
 /**
  * Represents the context used to configure routes and the policies to use.
  *

http://git-wip-us.apache.org/repos/asf/camel/blob/c03a34f6/camel-core/src/main/java/org/apache/camel/spi/CamelContextTracker.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/CamelContextTracker.java b/camel-core/src/main/java/org/apache/camel/spi/CamelContextTracker.java
index 6cce932..a94abce 100644
--- a/camel-core/src/main/java/org/apache/camel/spi/CamelContextTracker.java
+++ b/camel-core/src/main/java/org/apache/camel/spi/CamelContextTracker.java
@@ -28,14 +28,14 @@ public class CamelContextTracker {
      * Called when a context is created.
      */
     public void contextCreated(CamelContext camelContext) {
-    	// do nothing
+        // do nothing
     }
 
     public final void open() {
-    	CamelContextTrackerRegistry.INSTANCE.addTracker(this);
+        CamelContextTrackerRegistry.INSTANCE.addTracker(this);
     }
-    
+
     public final void close() {
-    	CamelContextTrackerRegistry.INSTANCE.removeTracker(this);
+        CamelContextTrackerRegistry.INSTANCE.removeTracker(this);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/c03a34f6/camel-core/src/test/java/org/apache/camel/impl/CamelContextTrackerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/CamelContextTrackerTest.java b/camel-core/src/test/java/org/apache/camel/impl/CamelContextTrackerTest.java
index dffa7ae..4909b4b 100644
--- a/camel-core/src/test/java/org/apache/camel/impl/CamelContextTrackerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/impl/CamelContextTrackerTest.java
@@ -20,7 +20,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import junit.framework.TestCase;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.spi.CamelContextTracker;
 import org.apache.camel.support.LifecycleStrategySupport;
@@ -31,16 +30,16 @@ public class CamelContextTrackerTest extends TestCase {
 
         private List<String> names = new ArrayList<String>();
 
-		@Override
-		public void contextCreated(CamelContext camelContext) {
-			camelContext.addLifecycleStrategy(new LifecycleStrategySupport() {
-				@Override
-				public void onContextStop(CamelContext context) {
-					names.remove(context.getName());
-				}
-			});
-			names.add(camelContext.getName());
-		}
+        @Override
+        public void contextCreated(CamelContext camelContext) {
+            camelContext.addLifecycleStrategy(new LifecycleStrategySupport() {
+                @Override
+                public void onContextStop(CamelContext context) {
+                    names.remove(context.getName());
+                }
+            });
+            names.add(camelContext.getName());
+        }
     }
 
     public void testContainerSet() throws Exception {
@@ -64,7 +63,7 @@ public class CamelContextTrackerTest extends TestCase {
             camel3.stop();
 
             assertEquals(0, tracker.names.size());
-            
+
         } finally {
             tracker.close();
         }


Mime
View raw message