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%2Fscheduledthreadpool%2FTestingScheduledThreadPoolImpl.java;fp=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Ftestingservices%2Fscheduledthreadpool%2FTestingScheduledThreadPoolImpl.java;h=459e45838402e601048f688be35a961f011e21bc;hp=9c0f56b1206c65b854b658b844b0a6a1224feb43;hb=2b78ca93f44c372fd72927db6cbd65f5d8387b49;hpb=c0e813ca83ce80d5f3fb340175ddaecd780c6aea diff --git a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java index 9c0f56b120..459e458384 100644 --- a/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.java +++ b/opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolImpl.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, @@ -18,24 +18,21 @@ import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator import org.opendaylight.controller.config.manager.testingservices.scheduledthreadpool.runtimebeans.TestingScheduledRuntimeBean; import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingThreadPoolIfc; -public class TestingScheduledThreadPoolImpl implements TestingThreadPoolIfc, - TestingScheduledThreadPoolIfc, Closeable { +public class TestingScheduledThreadPoolImpl implements TestingThreadPoolIfc, TestingScheduledThreadPoolIfc, Closeable { private static volatile int numberOfCloseMethodCalls = 0; private final ScheduledThreadPoolExecutor executor; private final RootRuntimeBeanRegistrator runtimeBeanRegistrator; - public static final List allExecutors = Lists - .newLinkedList(); + public static final List ALLEXECUTORS = Lists.newLinkedList(); - public TestingScheduledThreadPoolImpl( - final RootRuntimeBeanRegistrator runtimeBeanRegistrator, final int corePoolSize) { + public TestingScheduledThreadPoolImpl(final RootRuntimeBeanRegistrator runtimeBeanRegistrator, + final int corePoolSize) { this.runtimeBeanRegistrator = runtimeBeanRegistrator; executor = new ScheduledThreadPoolExecutor(corePoolSize); - allExecutors.add(executor); + ALLEXECUTORS.add(executor); HierarchicalRuntimeBeanRegistration hierarchicalRuntimeBeanRegistration = runtimeBeanRegistrator .registerRoot(new TestingScheduledRuntimeBean()); - hierarchicalRuntimeBeanRegistration.register("a", "b", - new TestingScheduledRuntimeBean()); + hierarchicalRuntimeBeanRegistration.register("a", "b", new TestingScheduledRuntimeBean()); } @Override @@ -61,15 +58,14 @@ public class TestingScheduledThreadPoolImpl implements TestingThreadPoolIfc, } public static void cleanUp() { - for (ScheduledThreadPoolExecutor executor : allExecutors) { + for (ScheduledThreadPoolExecutor executor : ALLEXECUTORS) { executor.shutdown(); } - allExecutors.clear(); + ALLEXECUTORS.clear(); numberOfCloseMethodCalls = 0; } public static int getNumberOfCloseMethodCalls() { return numberOfCloseMethodCalls; } - }