2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.config.manager.testingservices.parallelapsp;
10 import static com.google.common.base.Preconditions.checkArgument;
12 import java.io.Closeable;
13 import java.io.IOException;
15 import javax.annotation.concurrent.NotThreadSafe;
17 import org.opendaylight.controller.config.manager.testingservices.threadpool.TestingThreadPoolIfc;
19 import com.google.common.base.Strings;
22 public class TestingParallelAPSPImpl implements TestingAPSP, Closeable {
23 public static final int MINIMAL_NUMBER_OF_THREADS = 10;
24 private TestingThreadPoolIfc threadPool;
25 private String someParam;
27 public TestingParallelAPSPImpl(TestingThreadPoolIfc threadPool,
30 threadPool.getMaxNumberOfThreads() >= MINIMAL_NUMBER_OF_THREADS,
31 "Parameter 'threadPool' has not enough threads");
32 checkArgument(Strings.isNullOrEmpty(someParam) == false,
33 "Parameter 'someParam' is blank");
34 this.threadPool = threadPool;
35 this.someParam = someParam;
39 public int getMaxNumberOfThreads() {
40 return threadPool.getMaxNumberOfThreads();
44 public void close() throws IOException {
48 TestingThreadPoolIfc getThreadPool() {
52 void setSomeParam(String s) {
53 checkArgument(Strings.isNullOrEmpty(someParam) == false,
54 "Parameter 'someParam' is blank");
58 public String getSomeParam() {