/*
- * 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,
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<ThreadPoolExecutor> allExecutors = Collections
+ public static final List<ThreadPoolExecutor> ALL_EXECUTORS = Collections
.synchronizedList(Lists.<ThreadPoolExecutor>newLinkedList());
public TestingFixedThreadPool(final int threadCount, final String uniqueName) {
this.uniqueName = uniqueName;
executorService = (ThreadPoolExecutor) Executors
.newFixedThreadPool(threadCount);
- allExecutors.add(executorService);
+ ALL_EXECUTORS.add(executorService);
}
@Override
@Override
public void close() throws IOException {
executorService.shutdown();
- allExecutors.remove(executorService);
+ ALL_EXECUTORS.remove(executorService);
}
checkArgument(activeCount > 0);
executorService.setMaximumPoolSize(activeCount);
}
-
}