X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fthreadpool%2FTestingFixedThreadPool.java;h=35413a1b1fcc23541cf60b719d1386a5ece20324;hp=0f4f00f0baf223c40239e4379b2a6529c10c9a8f;hb=2b78ca93f44c372fd72927db6cbd65f5d8387b49;hpb=ed6019236d78a69577888f60064c3714eaa80f6a diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java index 0f4f00f0ba..35413a1b1f 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -26,22 +26,22 @@ public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable, private final String uniqueName; public static void cleanUp() { - for (ExecutorService executorService : allExecutors) { + for (ExecutorService executorService : ALL_EXECUTORS) { executorService.shutdown(); } - allExecutors.clear(); + ALL_EXECUTORS.clear(); } // for verification purposes: - public static final List allExecutors = Collections + public static final List ALL_EXECUTORS = Collections .synchronizedList(Lists.newLinkedList()); - public TestingFixedThreadPool(int threadCount, String uniqueName) { + public TestingFixedThreadPool(final int threadCount, final String uniqueName) { checkNotNull(uniqueName); this.uniqueName = uniqueName; executorService = (ThreadPoolExecutor) Executors .newFixedThreadPool(threadCount); - allExecutors.add(executorService); + ALL_EXECUTORS.add(executorService); } @Override @@ -52,7 +52,7 @@ public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable, @Override public void close() throws IOException { executorService.shutdown(); - allExecutors.remove(executorService); + ALL_EXECUTORS.remove(executorService); } @@ -66,9 +66,8 @@ public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable, } @Override - public void setMaximumNumberOfThreads(int activeCount) { + public void setMaximumNumberOfThreads(final int activeCount) { checkArgument(activeCount > 0); executorService.setMaximumPoolSize(activeCount); } - }