You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/09/04 07:34:52 UTC
[2/3] camel git commit: Fixed CS. This closes #1153.
Fixed CS. This closes #1153.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a69affc3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a69affc3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a69affc3
Branch: refs/heads/master
Commit: a69affc35cd343ed78d1a5245c3c1e3989b0c25d
Parents: ccf4425
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Sep 4 09:31:56 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Sep 4 09:31:56 2016 +0200
----------------------------------------------------------------------
.../spi/InstrumentedThreadPoolFactory.java | 26 ++++++++++++++++----
.../spi/InstrumentedThreadPoolFactoryTest.java | 26 ++++++++++++++++----
2 files changed, 42 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/a69affc3/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactory.java b/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactory.java
index 09d3e9c..caac226 100644
--- a/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactory.java
+++ b/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactory.java
@@ -1,5 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.camel.component.metrics.spi;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+
import com.codahale.metrics.InstrumentedExecutorService;
import com.codahale.metrics.InstrumentedScheduledExecutorService;
import com.codahale.metrics.MetricRegistry;
@@ -8,10 +28,6 @@ import org.apache.camel.spi.ThreadPoolFactory;
import org.apache.camel.spi.ThreadPoolProfile;
import org.apache.camel.util.ObjectHelper;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ThreadFactory;
-
/**
* This implements a {@link ThreadPoolFactory} and generates an Instrumented versions of ExecutorService used to
* monitor performance of each thread using Metrics.
@@ -34,7 +50,7 @@ public class InstrumentedThreadPoolFactory implements ThreadPoolFactory {
}
@Override
- public ExecutorService newCachedThreadPool(ThreadFactory threadFactory){
+ public ExecutorService newCachedThreadPool(ThreadFactory threadFactory) {
return new InstrumentedExecutorService(threadPoolFactory.newCachedThreadPool(threadFactory), metricRegistry);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/a69affc3/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java
index 6c16b0c..592cb14 100644
--- a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java
+++ b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java
@@ -1,5 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.camel.component.metrics.spi;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
import com.codahale.metrics.InstrumentedExecutorService;
import com.codahale.metrics.InstrumentedScheduledExecutorService;
import com.codahale.metrics.MetricRegistry;
@@ -14,11 +35,6 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;