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


Java ListenerTracker类代码示例

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


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

示例1: activate

import org.onosproject.event.ListenerTracker; //导入依赖的package包/类
@Activate
protected void activate() {
    deviceService = opticalView(deviceService);
    appId = coreService.registerApplication("org.onosproject.newoptical");

    idCounter = storageService.atomicCounterBuilder()
            .withName(OPTICAL_CONNECTIVITY_ID_COUNTER)
            .withMeteringDisabled()
            .build()
            .asAtomicCounter();

    eventDispatcher.addSink(OpticalPathEvent.class, listenerRegistry);

    listeners = new ListenerTracker();
    listeners.addListener(linkService, new InternalLinkListener())
            .addListener(intentService, new InternalIntentListener());

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:OpticalPathProvisioner.java

示例2: activate

import org.onosproject.event.ListenerTracker; //导入依赖的package包/类
@Activate
protected void activate() {
    appId = coreService.registerApplication("org.onosproject.events");
    log.debug("Registered as {}", appId);

    pruner = newSingleThreadScheduledExecutor(
              minPriority(groupedThreads("onos/events", "history-pruner", log)));

    pruner.scheduleWithFixedDelay(this::pruneEventHistoryTask,
                                  pruneInterval, pruneInterval, TimeUnit.SECONDS);

    listeners = new ListenerTracker();
    listeners.addListener(mastershipService, new InternalMastershipListener())
             .addListener(deviceService, new InternalDeviceListener())
             .addListener(linkService, new InternalLinkListener())
             .addListener(topologyService, new InternalTopologyListener())
             .addListener(hostService, new InternalHostListener())
             .addListener(clusterService, new InternalClusterListener());

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:EventHistoryManager.java

示例3: activate

import org.onosproject.event.ListenerTracker; //导入依赖的package包/类
@Activate
protected void activate() {
    appId = coreService.registerApplication("org.onosproject.events");
    log.debug("Registered as {}", appId);

    pruner = newSingleThreadScheduledExecutor(
              minPriority(groupedThreads("onos/events", "history-pruner", log)));

    pruner.scheduleWithFixedDelay(this::pruneEventHistoryTask,
                                  pruneInterval, pruneInterval, TimeUnit.SECONDS);

    listeners = new ListenerTracker();
    listeners.addListener(mastershipService, this::addEvent)
             .addListener(deviceService, new InternalDeviceListener())
             .addListener(linkService, this::addEvent)
             .addListener(topologyService, this::addEvent)
             .addListener(hostService, this::addEvent)
             .addListener(clusterService, this::addEvent)
             .addListener(edgeService, this::addEvent)
             .addListener(intentService, this::addEvent)
             .addListener(netcfgService, this::addEvent);

    log.info("Started");
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:25,代码来源:EventHistoryManager.java

示例4: activate

import org.onosproject.event.ListenerTracker; //导入依赖的package包/类
@Activate
protected void activate(ComponentContext context) {
    deviceService = opticalView(deviceService);
    appId = coreService.registerApplication("org.onosproject.newoptical");

    idCounter = storageService.getAtomicCounter(OPTICAL_CONNECTIVITY_ID_COUNTER);

    linkPathMap = storageService.<PacketLinkRealizedByOptical, OpticalConnectivity>consistentMapBuilder()
            .withSerializer(Serializer.using(LINKPATH_SERIALIZER.build()))
            .withName(LINKPATH_MAP_NAME)
            .withApplicationId(appId)
            .build();

    connectivityMap = storageService.<OpticalConnectivityId, OpticalConnectivity>consistentMapBuilder()
            .withSerializer(Serializer.using(CONNECTIVITY_SERIALIZER.build()))
            .withName(CONNECTIVITY_MAP_NAME)
            .withApplicationId(appId)
            .build();

    usedCrossConnectLinkSet = storageService.<Link>setBuilder()
            .withSerializer(Serializer.using(CROSSCONNECTLINKS_SERIALIZER.build()))
            .withName(CROSSCONNECTLINK_SET_NAME)
            .withApplicationId(appId)
            .build()
            .asDistributedSet();

    eventDispatcher.addSink(OpticalPathEvent.class, listenerRegistry);

    listeners = new ListenerTracker();
    listeners.addListener(linkService, new InternalLinkListener())
            .addListener(intentService, new InternalIntentListener());

    linkPathMap.addListener(storeListener);

    readComponentConfiguration(context);

    log.info("Started");
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:39,代码来源:OpticalPathProvisioner.java


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