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


Java RPCService类代码示例

本文整理汇总了Java中org.sdnplatform.sync.internal.rpc.RPCService的典型用法代码示例。如果您正苦于以下问题:Java RPCService类的具体用法?Java RPCService怎么用?Java RPCService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RPCService类属于org.sdnplatform.sync.internal.rpc包,在下文中一共展示了RPCService类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
public void init() throws SyncException {
    cg = new DefaultChannelGroup("Cluster Bootstrap", GlobalEventExecutor.INSTANCE);

    workerExecutor = new NioEventLoopGroup();
    timer = new HashedWheelTimer();
    
    bootstrap = new Bootstrap()
    .group(workerExecutor)
    .channel(NioSocketChannel.class)
    .option(ChannelOption.SO_REUSEADDR, true)
    .option(ChannelOption.SO_KEEPALIVE, true)
    .option(ChannelOption.TCP_NODELAY, true)
    .option(ChannelOption.SO_SNDBUF, RPCService.SEND_BUFFER_SIZE)
    .option(ChannelOption.SO_RCVBUF, RPCService.SEND_BUFFER_SIZE)
    .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, RPCService.CONNECT_TIMEOUT);
    
    pipelineFactory = new BootstrapChannelInitializer(timer, this);
    bootstrap.handler(pipelineFactory);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:20,代码来源:BootstrapClient.java

示例2: startUp

import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) 
        throws FloodlightModuleException {
    shutdown = false;
    workerExecutor = new NioEventLoopGroup();
    timer = new HashedWheelTimer();
    
    pipelineFactory = new RemoteSyncChannelInitializer(timer, this);
    
    final Bootstrap bootstrap = new Bootstrap()
    .channel(NioSocketChannel.class)
    .group(workerExecutor)
    .option(ChannelOption.SO_REUSEADDR, true)
    .option(ChannelOption.SO_KEEPALIVE, true)
    .option(ChannelOption.TCP_NODELAY, true)
    .option(ChannelOption.SO_SNDBUF, RPCService.SEND_BUFFER_SIZE)
    .option(ChannelOption.SO_RCVBUF, RPCService.SEND_BUFFER_SIZE)
    .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, RPCService.CONNECT_TIMEOUT)
    .handler(pipelineFactory);
    
    clientBootstrap = bootstrap;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:23,代码来源:RemoteSyncManager.java

示例3: init

import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
public void init() throws SyncException {
    cg = new DefaultChannelGroup("Cluster Bootstrap");

    bossExecutor = Executors.newCachedThreadPool();
    workerExecutor = Executors.newCachedThreadPool();

    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", 
                        RPCService.SEND_BUFFER_SIZE);
    bootstrap.setOption("child.receiveBufferSize", 
                        RPCService.SEND_BUFFER_SIZE);
    bootstrap.setOption("child.connectTimeoutMillis", 
                        RPCService.CONNECT_TIMEOUT);
    pipelineFactory = new BootstrapPipelineFactory(this);
    bootstrap.setPipelineFactory(pipelineFactory);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:22,代码来源:Bootstrap.java

示例4: startUp

import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) 
        throws FloodlightModuleException {
    shutdown = false;
    bossExecutor = Executors.newCachedThreadPool();
    workerExecutor = Executors.newCachedThreadPool();
    
    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", 
                        RPCService.SEND_BUFFER_SIZE);
    bootstrap.setOption("child.receiveBufferSize", 
                        RPCService.SEND_BUFFER_SIZE);
    bootstrap.setOption("child.connectTimeoutMillis", 
                        RPCService.CONNECT_TIMEOUT);
    pipelineFactory = new RemoteSyncPipelineFactory(this);
    bootstrap.setPipelineFactory(pipelineFactory);
    clientBootstrap = bootstrap;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:25,代码来源:RemoteSyncManager.java

示例5: init

import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
public void init() throws SyncException {
    cg = new DefaultChannelGroup("Cluster Bootstrap", GlobalEventExecutor.INSTANCE);

    workerExecutor = new NioEventLoopGroup();
    timer = new HashedWheelTimer();

    bootstrap = new Bootstrap()
    .group(workerExecutor)
    .channel(NioSocketChannel.class)
    .option(ChannelOption.SO_REUSEADDR, true)
    .option(ChannelOption.SO_KEEPALIVE, true)
    .option(ChannelOption.TCP_NODELAY, true)
    .option(ChannelOption.SO_SNDBUF, RPCService.SEND_BUFFER_SIZE)
    .option(ChannelOption.SO_RCVBUF, RPCService.SEND_BUFFER_SIZE)
    .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, RPCService.CONNECT_TIMEOUT);

    pipelineFactory = new BootstrapChannelInitializer(timer, this);
    bootstrap.handler(pipelineFactory);
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:20,代码来源:BootstrapClient.java

示例6: startUp

import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
        throws FloodlightModuleException {
    shutdown = false;
    workerExecutor = new NioEventLoopGroup();
    timer = new HashedWheelTimer();

    pipelineFactory = new RemoteSyncChannelInitializer(timer, this);

    final Bootstrap bootstrap = new Bootstrap()
    .channel(NioSocketChannel.class)
    .group(workerExecutor)
    .option(ChannelOption.SO_REUSEADDR, true)
    .option(ChannelOption.SO_KEEPALIVE, true)
    .option(ChannelOption.TCP_NODELAY, true)
    .option(ChannelOption.SO_SNDBUF, RPCService.SEND_BUFFER_SIZE)
    .option(ChannelOption.SO_RCVBUF, RPCService.SEND_BUFFER_SIZE)
    .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, RPCService.CONNECT_TIMEOUT)
    .handler(pipelineFactory);

    clientBootstrap = bootstrap;
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:23,代码来源:RemoteSyncManager.java

示例7: startUp

import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的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

示例8: startUp

import org.sdnplatform.sync.internal.rpc.RPCService; //导入依赖的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


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