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


Java Scope类代码示例

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


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

示例1: execute

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
@Override
public boolean execute(String[] tokens, String line)
        throws Exception {
    if (tokens.length < 3) {
        err.println("Usage: " + syntaxString());
        return false;
    }
    Scope scope = Scope.LOCAL;
    if ("global".equals(tokens[2]))
        scope = Scope.GLOBAL;

    syncClientSettings.storeName = tokens[1];
    syncManager.registerStore(syncClientSettings.storeName, scope);
    getStoreClient();
    return false;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:17,代码来源:SyncClient.java

示例2: handleRegisterRequest

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
@Override
protected void handleRegisterRequest(RegisterRequestMessage request,
                                     Channel channel) {
    try {
        Scope scope = TProtocolUtil.getScope(request.store.getScope());
        if (request.store.isPersist())
            syncManager.registerPersistentStore(request.store.storeName,
                                                scope);
        else
            syncManager.registerStore(request.store.storeName, scope);
        RegisterResponseMessage m = new RegisterResponseMessage();
        AsyncMessageHeader header = new AsyncMessageHeader();
        header.setTransactionId(request.getHeader().getTransactionId());
        m.setHeader(header);
        SyncMessage bsm =
                new SyncMessage(MessageType.REGISTER_RESPONSE);
        bsm.setRegisterResponse(m);
        channel.writeAndFlush(bsm);
    } catch (Exception e) {
        channel.writeAndFlush(getError(request.getHeader().getTransactionId(), e,
                               MessageType.REGISTER_REQUEST));
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:24,代码来源:RPCChannelHandler.java

示例3: init

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
        throws FloodlightModuleException {
    syncService = context.getServiceImpl(ISyncService.class);
    debugCounter = context.getServiceImpl(IDebugCounterService.class);

    try {
        syncService.registerStore(SYNC_STORE_NAME, Scope.GLOBAL);
    } catch (SyncException e) {
        throw new FloodlightModuleException(e);
    }
    
    Map<String,String> config = context.getConfigParams(this);
    if (config.containsKey("numWorkers")) {
        numWorkers = Integer.parseInt(config.get("numWorkers"));
    }
    if (config.containsKey("keysPerWorker")) {
        keysPerWorker = Integer.parseInt(config.get("keysPerWorker"));
    }
    if (config.containsKey("iterations")) {
        iterations = Integer.parseInt(config.get("iterations"));
    }
    if (config.containsKey("delay")) {
        delay = Integer.parseInt(config.get("delay"));
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:27,代码来源:SyncTorture.java

示例4: init

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
@Override
public void init(SyncManager syncManager, FloodlightModuleContext context) 
        throws SyncException {
    this.syncManager = syncManager;
    threadPool = context.getServiceImpl(IThreadPoolService.class);
    syncManager.registerPersistentStore(SYSTEM_NODE_STORE, Scope.GLOBAL);
    syncManager.registerPersistentStore(SYSTEM_UNSYNC_STORE, 
                                        Scope.UNSYNCHRONIZED);
    this.nodeStoreClient = 
            syncManager.getStoreClient(SYSTEM_NODE_STORE, 
                                       Short.class, Node.class);
    this.nodeStoreClient.addStoreListener(new ShortListener());
    this.unsyncStoreClient = 
            syncManager.getStoreClient(SYSTEM_UNSYNC_STORE, 
                                       String.class, String.class);
    this.unsyncStoreClient.addStoreListener(new StringListener());
    
    config = context.getConfigParams(syncManager);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:20,代码来源:SyncStoreCCProvider.java

示例5: setupSyncManager

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
protected void setupSyncManager(FloodlightModuleContext fmc,
                                SyncManager syncManager, Node thisNode)
        throws Exception {        
    fmc.addService(IThreadPoolService.class, tp);
    fmc.addService(IDebugCounterService.class, new MockDebugCounterService());
    fmc.addService(IDebugEventService.class, new MockDebugEventService());
    fmc.addConfigParam(syncManager, "configProviders", 
                       PropertyCCProvider.class.getName());
    fmc.addConfigParam(syncManager, "nodes", nodeString);
    fmc.addConfigParam(syncManager, "thisNode", ""+thisNode.getNodeId());
    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);
    syncManager.registerStore("local", Scope.LOCAL);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:25,代码来源:SyncManagerTest.java

示例6: setUp

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的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);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:24,代码来源:RemoteStoreTest.java

示例7: handleRegisterRequest

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
@Override
protected void handleRegisterRequest(RegisterRequestMessage request,
                                     Channel channel) {
    try {
        Scope scope = TProtocolUtil.getScope(request.store.getScope());
        if (request.store.isPersist())
            syncManager.registerPersistentStore(request.store.storeName,
                                                scope);
        else
            syncManager.registerStore(request.store.storeName, scope);
        RegisterResponseMessage m = new RegisterResponseMessage();
        AsyncMessageHeader header = new AsyncMessageHeader();
        header.setTransactionId(request.getHeader().getTransactionId());
        m.setHeader(header);
        SyncMessage bsm =
                new SyncMessage(MessageType.REGISTER_RESPONSE);
        bsm.setRegisterResponse(m);
        channel.write(bsm);
    } catch (Exception e) {
        channel.write(getError(request.getHeader().getTransactionId(), e,
                               MessageType.REGISTER_REQUEST));
    }
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:24,代码来源:RPCChannelHandler.java

示例8: startUp

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context)
		throws FloodlightModuleException {
	
	switchService.addOFSwitchListener(this);
	syncService.addRPCListener(this);
	
	try {
		this.syncService.registerStore("FT_Switches", Scope.GLOBAL);
		this.storeFT = this.syncService
				.getStoreClient("FT_Switches",
						String.class,
						String.class);
		this.storeFT.addStoreListener(this);
	} catch (SyncException e) {
		throw new FloodlightModuleException("Error while setting up sync service", e);
	}
	
}
 
开发者ID:DylanAPDavis,项目名称:arscheduler,代码行数:20,代码来源:FT.java

示例9: setupSyncManager

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
protected void setupSyncManager(FloodlightModuleContext fmc,
                                SyncManager syncManager, Node thisNode)
        throws Exception {        
    fmc.addService(IThreadPoolService.class, tp);
    fmc.addService(IDebugCounterService.class, new MockDebugCounterService());
    fmc.addService(IDebugEventService.class, new MockDebugEventService());
    fmc.addConfigParam(syncManager, "configProviders", 
                       PropertyCCProvider.class.getName());
    fmc.addConfigParam(syncManager, "nodes", nodeString);
    fmc.addConfigParam(syncManager, "thisNodeId", ""+thisNode.getNodeId());
    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);
    syncManager.registerStore("local", Scope.LOCAL);
}
 
开发者ID:DylanAPDavis,项目名称:arscheduler,代码行数:25,代码来源:SyncManagerTest.java

示例10: setupSyncManager

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
protected void setupSyncManager(FloodlightModuleContext fmc,
                                SyncManager syncManager, Node thisNode)
        throws Exception {        
    fmc.addService(IThreadPoolService.class, tp);
    fmc.addService(IDebugCounterService.class, new NullDebugCounter());
    fmc.addConfigParam(syncManager, "configProviders", 
                       PropertyCCProvider.class.getName());
    fmc.addConfigParam(syncManager, "nodes", nodeString);
    fmc.addConfigParam(syncManager, "thisNode", ""+thisNode.getNodeId());
    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);
    syncManager.registerStore("local", Scope.LOCAL);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:24,代码来源:SyncManagerTest.java

示例11: setUp

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的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);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:23,代码来源:RemoteStoreTest.java

示例12: init

import org.sdnplatform.sync.ISyncService.Scope; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
        throws FloodlightModuleException {
    syncService = context.getServiceImpl(ISyncService.class);
    debugCounter = context.getServiceImpl(IDebugCounterService.class);

    try {
        syncService.registerStore(SYNC_STORE_NAME, Scope.GLOBAL);
    } catch (SyncException e) {
        throw new FloodlightModuleException(e);
    }

    Map<String,String> config = context.getConfigParams(this);
    if (config.containsKey("numWorkers")) {
        numWorkers = Integer.parseInt(config.get("numWorkers"));
    }
    if (config.containsKey("keysPerWorker")) {
        keysPerWorker = Integer.parseInt(config.get("keysPerWorker"));
    }
    if (config.containsKey("iterations")) {
        iterations = Integer.parseInt(config.get("iterations"));
    }
    if (config.containsKey("delay")) {
        delay = Integer.parseInt(config.get("delay"));
    }
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:27,代码来源:SyncTorture.java


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