当前位置: 首页>>代码示例>>Java>>正文


Java SingletonTask.reschedule方法代码示例

本文整理汇总了Java中net.floodlightcontroller.core.util.SingletonTask.reschedule方法的典型用法代码示例。如果您正苦于以下问题:Java SingletonTask.reschedule方法的具体用法?Java SingletonTask.reschedule怎么用?Java SingletonTask.reschedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.floodlightcontroller.core.util.SingletonTask的用法示例。


在下文中一共展示了SingletonTask.reschedule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startClients

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
/**
 * Connect to remote servers.  We'll initiate the connection to
 * any nodes with a lower ID so that there will be a single connection
 * between each pair of nodes which we'll use symmetrically
 */
protected void startClients(RPCChannelInitializer channelInitializer) {
    final Bootstrap bootstrap = new Bootstrap();
    bootstrap.group(workerGroup)
    .channel(NioSocketChannel.class)
    .option(ChannelOption.SO_REUSEADDR, true)
    .option(ChannelOption.SO_KEEPALIVE, true)
    .option(ChannelOption.TCP_NODELAY, true)
    .option(ChannelOption.SO_SNDBUF, SEND_BUFFER_SIZE)
    .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, CONNECT_TIMEOUT)
    .handler(channelInitializer);
    clientBootstrap = bootstrap;

    ScheduledExecutorService ses = 
            syncManager.getThreadPool().getScheduledExecutor();
    reconnectTask = new SingletonTask(ses, new ConnectTask());
    reconnectTask.reschedule(0, TimeUnit.SECONDS);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:23,代码来源:RPCService.java

示例2: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
	// thread to do flow reconcile
	ScheduledExecutorService ses = threadPoolService.getScheduledExecutor();
	flowReconcileTask = new SingletonTask(ses, new Runnable() {
		@Override
		public void run() {
			try {
				if (doReconcile()) {
					flowReconcileTask.reschedule(
							FLOW_RECONCILE_DELAY_MILLISEC,
							TimeUnit.MILLISECONDS);
				}
			} catch (Exception e) {
				logger.warn("Exception in doReconcile(): {}", e);
			}
		}
	});

	String packetInName = OFType.PACKET_IN.getClass().getName();
	packetInName = packetInName.substring(packetInName.lastIndexOf('.')+1);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:23,代码来源:FlowReconcileManager.java

示例3: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
	clearCurrentTopology();
	// Initialize role to floodlight provider role.
	this.role = floodlightProviderService.getRole();

	ScheduledExecutorService ses = threadPoolService.getScheduledExecutor();
	newInstanceTask = new SingletonTask(ses, new UpdateTopologyWorker());

	if (role != HARole.STANDBY) {
		newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS, TimeUnit.MILLISECONDS);
	}

	linkDiscoveryService.addListener(this);
	floodlightProviderService.addOFMessageListener(OFType.PACKET_IN, this);
	floodlightProviderService.addHAListener(this.haListener);
	addRestletRoutable();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:19,代码来源:TopologyManager.java

示例4: startClients

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
/**
 * Connect to remote servers.  We'll initiate the connection to
 * any nodes with a lower ID so that there will be a single connection
 * between each pair of nodes which we'll use symmetrically
 */
protected void startClients(ChannelPipelineFactory pipelineFactory) {
    final ClientBootstrap bootstrap =
            new ClientBootstrap(
                 new NioClientSocketChannelFactory(bossExecutor,
                                                   workerExecutor));
    bootstrap.setOption("child.reuseAddr", true);
    bootstrap.setOption("child.keepAlive", true);
    bootstrap.setOption("child.tcpNoDelay", true);
    bootstrap.setOption("child.sendBufferSize", SEND_BUFFER_SIZE);
    bootstrap.setOption("child.connectTimeoutMillis", CONNECT_TIMEOUT);
    bootstrap.setPipelineFactory(pipelineFactory);
    clientBootstrap = bootstrap;

    ScheduledExecutorService ses = 
            syncManager.getThreadPool().getScheduledExecutor();
    reconnectTask = new SingletonTask(ses, new ConnectTask());
    reconnectTask.reschedule(0, TimeUnit.SECONDS);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:24,代码来源:RPCService.java

示例5: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
	clearCurrentTopology();
	// Initialize role to floodlight provider role.
	this.role = floodlightProviderService.getRole();

	ScheduledExecutorService ses = threadPoolService.getScheduledExecutor();
	newInstanceTask = new SingletonTask(ses, new UpdateTopologyWorker());

	if (role != HARole.STANDBY)
		newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS,
				TimeUnit.MILLISECONDS);

	linkDiscoveryService.addListener(this);
	floodlightProviderService.addOFMessageListener(OFType.PACKET_IN, this);
	floodlightProviderService.addHAListener(this.haListener);
	addRestletRoutable();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:19,代码来源:TopologyManager.java

示例6: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
    clearCurrentTopology();
    // Initialize role to floodlight provider role.
    this.role = floodlightProvider.getRole();

    ScheduledExecutorService ses = threadPool.getScheduledExecutor();
    newInstanceTask = new SingletonTask(ses, new UpdateTopologyWorker());

    if (role != Role.SLAVE)
        newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS,
                               TimeUnit.MILLISECONDS);

    linkDiscovery.addListener(this);
    floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
    floodlightProvider.addHAListener(this.haListener);
    addRestletRoutable();
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:19,代码来源:TopologyManager.java

示例7: startClients

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
/**
 * Connect to remote servers.  We'll initiate the connection to
 * any nodes with a lower ID so that there will be a single connection
 * between each pair of nodes which we'll use symmetrically
 */
protected void startClients(RPCChannelInitializer channelInitializer) {
    final Bootstrap bootstrap = new Bootstrap();
    bootstrap.group(workerGroup)
    .channel(NioSocketChannel.class)
    .option(ChannelOption.SO_REUSEADDR, true)
    .option(ChannelOption.SO_KEEPALIVE, true)
    .option(ChannelOption.TCP_NODELAY, true)
    .option(ChannelOption.SO_SNDBUF, SEND_BUFFER_SIZE)
    .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, CONNECT_TIMEOUT)
    .handler(channelInitializer);
    clientBootstrap = bootstrap;

    ScheduledExecutorService ses =
            syncManager.getThreadPool().getScheduledExecutor();
    reconnectTask = new SingletonTask(ses, new ConnectTask());
    reconnectTask.reschedule(0, TimeUnit.SECONDS);
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:23,代码来源:RPCService.java

示例8: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
        throws FloodlightModuleException {

    rpcService = new RPCService(this, debugCounter);

    cleanupTask = new SingletonTask(threadPool.getScheduledExecutor(),
                                    new CleanupTask());
    cleanupTask.reschedule(CLEANUP_INTERVAL +
                           random.nextInt(30), TimeUnit.SECONDS);

    antientropyTask = new SingletonTask(threadPool.getScheduledExecutor(),
                                   new AntientropyTask());
    antientropyTask.reschedule(ANTIENTROPY_INTERVAL +
                               random.nextInt(30), TimeUnit.SECONDS);

    final ThreadGroup tg = new ThreadGroup("Hint Workers");
    tg.setMaxPriority(Thread.NORM_PRIORITY - 2);
    ThreadFactory f = new ThreadFactory() {
        AtomicInteger id = new AtomicInteger();

        @Override
        public Thread newThread(Runnable runnable) {
            return new Thread(tg, runnable,
                              "HintWorker-" + id.getAndIncrement());
        }
    };
    hintThreadPool = Executors.newCachedThreadPool(f);
    for (int i = 0; i < SYNC_WORKER_POOL; i++) {
        hintThreadPool.execute(new HintWorker());
    }

    doUpdateConfiguration();
    rpcService.run();

    updateConfigTask =
            new SingletonTask(threadPool.getScheduledExecutor(),
                              new UpdateConfigTask());
    updateConfigTask.reschedule(CONFIG_RESCAN_INTERVAL, TimeUnit.SECONDS);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:41,代码来源:SyncManager.java

示例9: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
    // thread to do flow reconcile
    ScheduledExecutorService ses = threadPool.getScheduledExecutor();
    flowReconcileTask = new SingletonTask(ses, new Runnable() {
        @Override
        public void run() {
            try {
                if (doReconcile()) {
                    flowReconcileTask.reschedule(
                        FLOW_RECONCILE_DELAY_MILLISEC,
                        TimeUnit.MILLISECONDS);
                }
            } catch (Exception e) {
                logger.warn("Exception in doReconcile(): {}", e);
            }
        }
    });

    String packetInName = OFType.PACKET_IN.toClass().getName();
    packetInName = packetInName.substring(packetInName.lastIndexOf('.')+1);

    // Construct controller counter for the packet_in
    controllerPktInCounterName =
        CounterStore.createCounterName(ICounterStoreService.CONTROLLER_NAME,
                                       -1,
                                       packetInName);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:29,代码来源:FlowReconcileManager.java

示例10: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
    // thread to do flow reconcile
    ScheduledExecutorService ses = threadPool.getScheduledExecutor();
    flowReconcileTask = new SingletonTask(ses, new Runnable() {
        @Override
        public void run() {
            try {
                if (doReconcile()) {
                    flowReconcileTask.reschedule(
                        FLOW_RECONCILE_DELAY_MILLISEC,
                        TimeUnit.MILLISECONDS);
                }
            } catch (Exception e) {
                logger.warn("Exception in doReconcile(): {}",
                            e.getMessage());
                e.printStackTrace();
            }
        }
    });
    
    String packetInName = OFType.PACKET_IN.toClass().getName();
    packetInName = packetInName.substring(packetInName.lastIndexOf('.')+1); 
    
    // Construct controller counter for the packet_in
    controllerPktInCounterName =
        CounterStore.createCounterName(ICounterStoreService.CONTROLLER_NAME, 
                                       -1,
                                       packetInName);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:31,代码来源:FlowReconcileManager.java

示例11: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
    floodlightProvider.addOFSwitchListener(this);
    linkDiscovery.addListener(this);
    hostService.addHostListener(this);

    eventChannel = datagridService.createChannel(
                            TopologyManager.EVENT_CHANNEL_NAME,
                            byte[].class,
                            TopologyEvent.class);

    mutableTopology = topologyService.getTopology();

    // Run the cleanup thread
    String enableCleanup =
            context.getConfigParams(this).get(ENABLE_CLEANUP_PROPERTY);
    if (enableCleanup != null
            && enableCleanup.equalsIgnoreCase("false")) {
        cleanupEnabled = false;
    }

    log.debug("Cleanup thread is {}enabled", (cleanupEnabled) ? "" : "not ");

    if (cleanupEnabled) {
        IThreadPoolService threadPool =
                context.getServiceImpl(IThreadPoolService.class);
        cleanupTask = new SingletonTask(threadPool.getScheduledExecutor(),
                new SwitchCleanup());
        // Run the cleanup task immediately on startup
        cleanupTask.reschedule(0, TimeUnit.SECONDS);
    }

    // Run the Delayed Operations Handler thread
    delayedOperationsHandler.start();
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:36,代码来源:TopologyPublisher.java

示例12: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
    ScheduledExecutorService ses = threadPool.getScheduledExecutor();
    newInstanceTask = new SingletonTask(ses, new UpdateTopologyWorker());

    if (floodlightProvider.getRole() != Role.SLAVE)
        newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS,
                               TimeUnit.MILLISECONDS);

    linkDiscovery.addListener(this);
    floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
    floodlightProvider.addHAListener(this);
    addRestletRoutable();
    registerTopologyDebugCounters();
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:16,代码来源:TopologyManager.java

示例13: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
    ScheduledExecutorService ses = threadPool.getScheduledExecutor();
    newInstanceTask = new SingletonTask(ses, new UpdateTopologyWorker());

    if (floodlightProvider.getRole() != Role.SLAVE)
        newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS,
                               TimeUnit.MILLISECONDS);

    linkDiscovery.addListener(this);
    floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
    floodlightProvider.addHAListener(this);
    addRestletRoutable();
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:15,代码来源:TopologyManager.java

示例14: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
		throws FloodlightModuleException {

	timer = new HashedWheelTimer();
	rpcService = new RPCService(this, debugCounter, timer);

	cleanupTask = new SingletonTask(threadPool.getScheduledExecutor(),
			new CleanupTask());
	cleanupTask.reschedule(CLEANUP_INTERVAL +
			random.nextInt(30), TimeUnit.SECONDS);

	antientropyTask = new SingletonTask(threadPool.getScheduledExecutor(),
			new AntientropyTask());
	antientropyTask.reschedule(ANTIENTROPY_INTERVAL +
			random.nextInt(30), TimeUnit.SECONDS);

	final ThreadGroup tg = new ThreadGroup("Hint Workers");
	tg.setMaxPriority(Thread.NORM_PRIORITY - 2);
	ThreadFactory f = new ThreadFactory() {
		AtomicInteger id = new AtomicInteger();

		@Override
		public Thread newThread(Runnable runnable) {
			return new Thread(tg, runnable,
					"HintWorker-" + id.getAndIncrement());
		}
	};
	hintThreadPool = Executors.newCachedThreadPool(f);
	for (int i = 0; i < SYNC_WORKER_POOL; i++) {
		hintThreadPool.execute(new HintWorker());
	}

	doUpdateConfiguration();
	rpcService.run();

	updateConfigTask =
			new SingletonTask(threadPool.getScheduledExecutor(),
					new UpdateConfigTask());
	updateConfigTask.reschedule(CONFIG_RESCAN_INTERVAL, TimeUnit.SECONDS);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:42,代码来源:SyncManager.java

示例15: startUp

import net.floodlightcontroller.core.util.SingletonTask; //导入方法依赖的package包/类
@Override
@LogMessageDocs({
        @LogMessageDoc(level = "ERROR",
                message = "No storage source found.",
                explanation = "Storage source was not initialized; cannot initialize "
                        +
                        "link discovery.",
                recommendation = LogMessageDoc.REPORT_CONTROLLER_BUG),
        @LogMessageDoc(level = "ERROR",
                message = "Error in installing listener for " +
                        "switch config table {table}",
                explanation = "Failed to install storage notification for the " +
                        "switch config table",
                recommendation = LogMessageDoc.REPORT_CONTROLLER_BUG),
        @LogMessageDoc(level = "ERROR",
                message = "No storage source found.",
                explanation = "Storage source was not initialized; cannot initialize "
                        +
                        "link discovery.",
                recommendation = LogMessageDoc.REPORT_CONTROLLER_BUG),
        @LogMessageDoc(level = "ERROR",
                message = "Exception in LLDP send timer.",
                explanation = "An unknown error occured while sending LLDP " +
                        "messages to switches.",
                recommendation = LogMessageDoc.CHECK_SWITCH)
})
public void startUp(FloodlightModuleContext context) {
    ScheduledExecutorService ses = threadPool.getScheduledExecutor();
    controller = context.getServiceImpl(IFloodlightProviderService.class);

    discoveryTask = new SingletonTask(ses, new Runnable() {
        @Override
        public void run() {
            try {
                discoverLinks();
            } catch (Exception e) {
                log.error("Exception in LLDP send timer.", e);
            } finally {
                log.trace("Rescheduling discovery task");
                discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL,
                        TimeUnit.SECONDS);
            }
        }
    });

    discoveryTask.reschedule(DISCOVERY_TASK_INTERVAL, TimeUnit.SECONDS);

    // Register for the OpenFlow messages we want to receive
    floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
    floodlightProvider.addOFMessageListener(OFType.PORT_STATUS, this);
    // Register for switch updates
    floodlightProvider.addOFSwitchListener(this);
    restApi.addRestletRoutable(new LinkDiscoveryWebRoutable());
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:55,代码来源:LinkDiscoveryManager.java


注:本文中的net.floodlightcontroller.core.util.SingletonTask.reschedule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。