本文整理汇总了Java中net.floodlightcontroller.threadpool.ThreadPool.init方法的典型用法代码示例。如果您正苦于以下问题:Java ThreadPool.init方法的具体用法?Java ThreadPool.init怎么用?Java ThreadPool.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.floodlightcontroller.threadpool.ThreadPool
的用法示例。
在下文中一共展示了ThreadPool.init方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connect
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
/**
* Set up the remote sync manager and prepare for requests
* @throws Exception
*/
protected void connect() throws Exception {
FloodlightModuleContext fmc = new FloodlightModuleContext();
ThreadPool tp = new ThreadPool();
syncManager = new RemoteSyncManager();
fmc.addService(IThreadPoolService.class, tp);
fmc.addService(ISyncService.class, syncManager);
fmc.addConfigParam(syncManager, "hostname", settings.hostname);
fmc.addConfigParam(syncManager, "port",
Integer.toString(settings.port));
if (settings.authScheme != null) {
fmc.addConfigParam(syncManager, "authScheme",
settings.authScheme.toString());
fmc.addConfigParam(syncManager, "keyStorePath", settings.keyStorePath);
fmc.addConfigParam(syncManager, "keyStorePassword",
settings.keyStorePassword);
}
tp.init(fmc);
syncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
out.println("Using remote sync service at " +
settings.hostname + ":" + settings.port);
}
示例2: testPerfOneNode
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
@Test
@Ignore
public void testPerfOneNode() throws Exception {
tearDown();
tp = new ThreadPool();
tp.init(null);
tp.startUp(null);
nodes = new ArrayList<Node>();
nodes.add(new Node("localhost", 40101, (short)1, (short)1));
nodeString = mapper.writeValueAsString(nodes);
SyncManager sm = new SyncManager();
FloodlightModuleContext fmc = new FloodlightModuleContext();
setupSyncManager(fmc, sm, nodes.get(0));
fmc.addService(ISyncService.class, sm);
SyncTorture st = new SyncTorture();
//fmc.addConfigParam(st, "iterations", "1");
st.init(fmc);
st.startUp(fmc);
Thread.sleep(10000);
}
示例3: setUp
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
FloodlightModuleContext fmc = new FloodlightModuleContext();
tp = new ThreadPool();
syncManager = new SyncManager();
remoteSyncManager = new RemoteSyncManager();
fmc.addService(IThreadPoolService.class, tp);
fmc.addService(IDebugCounterService.class, new MockDebugCounterService());
fmc.addService(IDebugEventService.class, new MockDebugEventService());
fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
tp.init(fmc);
syncManager.init(fmc);
remoteSyncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
remoteSyncManager.startUp(fmc);
syncManager.registerStore("local", Scope.LOCAL);
}
示例4: setUp
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
FloodlightModuleContext fmc = new FloodlightModuleContext();
tp = new ThreadPool();
syncManager = new SyncManager();
remoteSyncManager = new RemoteSyncManager();
fmc.addService(IThreadPoolService.class, tp);
fmc.addService(IDebugCounterService.class, new NullDebugCounter());
fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
tp.init(fmc);
syncManager.init(fmc);
remoteSyncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
remoteSyncManager.startUp(fmc);
syncManager.registerStore("local", Scope.LOCAL);
}
示例5: connect
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
/**
* Set up the remote sync manager and prepare for requests
* @throws Exception
*/
protected void connect() throws Exception {
FloodlightModuleContext fmc = new FloodlightModuleContext();
ThreadPool tp = new ThreadPool();
syncManager = new RemoteSyncManager();
fmc.addService(IThreadPoolService.class, tp);
fmc.addService(ISyncService.class, syncManager);
fmc.addConfigParam(syncManager, "hostname", settings.hostname);
fmc.addConfigParam(syncManager, "port",
Integer.toString(settings.port));
if (settings.authScheme != null) {
fmc.addConfigParam(syncManager, "authScheme",
settings.authScheme.toString());
fmc.addConfigParam(syncManager, "keyStorePath", settings.keyStorePath);
fmc.addConfigParam(syncManager, "keyStorePassword",
settings.keyStorePassword);
}
tp.init(fmc);
syncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
out.println("Using remote sync service at " +
settings.hostname + ":" + settings.port);
}
示例6: setUp
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
keyStoreFile = new File(keyStoreFolder.getRoot(),
"keystore.jceks");
CryptoUtil.writeSharedSecret(keyStoreFile.getAbsolutePath(),
keyStorePassword,
CryptoUtil.secureRandom(16));
nodes = new ArrayList<Node>();
nodes.add(new Node("localhost", 40101, (short)1, (short)1));
nodeString = mapper.writeValueAsString(nodes);
debugCounterService = new MockDebugCounterService();
tp = new ThreadPool();
syncManager = new SyncManager();
FloodlightModuleContext fmc = new FloodlightModuleContext();
fmc.addService(IThreadPoolService.class, tp);
fmc.addService(IDebugCounterService.class, new MockDebugCounterService());
fmc.addService(IDebugEventService.class, new MockDebugEventService());
fmc.addConfigParam(syncManager, "nodes", nodeString);
fmc.addConfigParam(syncManager, "thisNode", ""+1);
fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
fmc.addConfigParam(syncManager, "authScheme", "CHALLENGE_RESPONSE");
fmc.addConfigParam(syncManager, "keyStorePath",
keyStoreFile.getAbsolutePath());
fmc.addConfigParam(syncManager, "keyStorePassword", keyStorePassword);
tp.init(fmc);
syncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
syncManager.registerStore("global", Scope.GLOBAL);
}
示例7: setUp
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
keyStoreFile = new File(keyStoreFolder.getRoot(), "keystore.jceks");
CryptoUtil.writeSharedSecret(keyStoreFile.getAbsolutePath(),
keyStorePassword,
CryptoUtil.secureRandom(16));
nodes = new ArrayList<Node>();
nodes.add(new Node("localhost", 40101, (short)1, (short)1));
nodeString = mapper.writeValueAsString(nodes);
debugCounterService = new MockDebugCounterService();
tp = new ThreadPool();
syncManager = new SyncManager();
FloodlightModuleContext fmc = new FloodlightModuleContext();
fmc.addService(IThreadPoolService.class, tp);
fmc.addService(IDebugCounterService.class, new MockDebugCounterService());
fmc.addService(IDebugEventService.class, new MockDebugEventService());
fmc.addConfigParam(syncManager, "nodes", nodeString);
fmc.addConfigParam(syncManager, "thisNodeId", ""+1);
fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
fmc.addConfigParam(syncManager, "authScheme", "CHALLENGE_RESPONSE");
fmc.addConfigParam(syncManager, "keyStorePath",
keyStoreFile.getAbsolutePath());
fmc.addConfigParam(syncManager, "keyStorePassword", keyStorePassword);
tp.init(fmc);
syncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
syncManager.registerStore("global", Scope.GLOBAL);
}
示例8: setUp
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
keyStoreFile = new File(keyStoreFolder.getRoot(),
"keystore.jceks");
CryptoUtil.writeSharedSecret(keyStoreFile.getAbsolutePath(),
keyStorePassword,
CryptoUtil.secureRandom(16));
nodes = new ArrayList<Node>();
nodes.add(new Node("localhost", 40101, (short)1, (short)1));
nodeString = mapper.writeValueAsString(nodes);
tp = new ThreadPool();
syncManager = new SyncManager();
FloodlightModuleContext fmc = new FloodlightModuleContext();
fmc.addService(IThreadPoolService.class, tp);
fmc.addService(IDebugCounterService.class, new NullDebugCounter());
fmc.addConfigParam(syncManager, "nodes", nodeString);
fmc.addConfigParam(syncManager, "thisNode", ""+1);
fmc.addConfigParam(syncManager, "persistenceEnabled", "false");
fmc.addConfigParam(syncManager, "authScheme", "CHALLENGE_RESPONSE");
fmc.addConfigParam(syncManager, "keyStorePath",
keyStoreFile.getAbsolutePath());
fmc.addConfigParam(syncManager, "keyStorePassword", keyStorePassword);
tp.init(fmc);
syncManager.init(fmc);
tp.startUp(fmc);
syncManager.startUp(fmc);
syncManager.registerStore("global", Scope.GLOBAL);
}
示例9: doSetUp
import net.floodlightcontroller.threadpool.ThreadPool; //导入方法依赖的package包/类
public void doSetUp(HARole role) throws Exception {
FloodlightModuleContext fmc = new FloodlightModuleContext();
FloodlightProvider cm = new FloodlightProvider();
fmc.addConfigParam(cm, "role", role.toString());
controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
fmc.addService(IFloodlightProviderService.class, controller);
MemoryStorageSource memstorage = new MemoryStorageSource();
fmc.addService(IStorageSourceService.class, memstorage);
RestApiServer restApi = new RestApiServer();
fmc.addService(IRestApiService.class, restApi);
ThreadPool threadPool = new ThreadPool();
fmc.addService(IThreadPoolService.class, threadPool);
// TODO: should mock IDebugCounterService and make sure
// the expected counters are updated.
MockDebugCounterService debugCounterService = new MockDebugCounterService();
fmc.addService(IDebugCounterService.class, debugCounterService);
DebugEventService debugEventService = new DebugEventService();
fmc.addService(IDebugEventService.class, debugEventService);
switchManager = new OFSwitchManager();
fmc.addService(IOFSwitchService.class, switchManager);
MockSyncService syncService = new MockSyncService();
fmc.addService(ISyncService.class, syncService);
IShutdownService shutdownService = createMock(IShutdownService.class);
shutdownService.registerShutdownListener(anyObject(IShutdownListener.class));
expectLastCall().anyTimes();
replay(shutdownService);
fmc.addService(IShutdownService.class, shutdownService);
verify(shutdownService);
threadPool.init(fmc);
syncService.init(fmc);
switchManager.init(fmc);
debugCounterService.init(fmc);
memstorage.init(fmc);
debugEventService.init(fmc);
restApi.init(fmc);
cm.init(fmc);
syncService.init(fmc);
switchManager.startUpBase(fmc);
debugCounterService.startUp(fmc);
memstorage.startUp(fmc);
debugEventService.startUp(fmc);
threadPool.startUp(fmc);
restApi.startUp(fmc);
cm.startUp(fmc);
}