本文整理汇总了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");
}
示例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");
}
示例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");
}
示例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");
}