本文整理汇总了Java中org.apache.felix.scr.annotations.Activate类的典型用法代码示例。如果您正苦于以下问题:Java Activate类的具体用法?Java Activate怎么用?Java Activate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Activate类属于org.apache.felix.scr.annotations包,在下文中一共展示了Activate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
public void activate() {
eventDispatcher.addSink(PartitionEvent.class, listenerRegistry);
currentClusterMetadata.set(metadataService.getClusterMetadata());
metadataService.addListener(metadataListener);
currentClusterMetadata.get()
.getPartitions()
.stream()
.forEach(partition -> partitions.put(partition.getId(), new StoragePartition(partition,
messagingService,
clusterService,
CatalystSerializers.getSerializer(),
new File(System.getProperty("karaf.data") + "/partitions/" + partition.getId()))));
CompletableFuture<Void> openFuture = CompletableFuture.allOf(partitions.values()
.stream()
.map(StoragePartition::open)
.toArray(CompletableFuture[]::new));
openFuture.join();
log.info("Started");
}
示例2: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的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");
}
示例3: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
protected void activate() {
cache = new ModelCache(new DefaultServiceBundle(), eventDispatcher);
eventHandler = Executors.newSingleThreadExecutor(Tools.groupedThreads("onos/ui/topo", "event-handler"));
eventDispatcher.addSink(UiModelEvent.class, listenerRegistry);
clusterService.addListener(clusterListener);
mastershipService.addListener(mastershipListener);
regionService.addListener(regionListener);
deviceService.addListener(deviceListener);
linkService.addListener(linkListener);
hostService.addListener(hostListener);
intentService.addListener(intentListener);
flowService.addListener(flowRuleListener);
cache.load();
log.info("Started");
}
示例4: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
public void activate() {
appId = coreService.registerApplication(VTNRSC_APP);
subnetStore = storageService.<SubnetId, Subnet>consistentMapBuilder()
.withName(SUBNET)
.withApplicationId(appId)
.withPurgeOnUninstall()
.withSerializer(Serializer.using(Arrays.asList(KryoNamespaces.API),
Subnet.class,
SubnetId.class,
TenantNetworkId.class,
TenantId.class,
HostRoute.class,
DefaultHostRoute.class,
Subnet.Mode.class,
AllocationPool.class,
DefaultAllocationPool.class,
DefaultSubnet.class,
IpAddress.Version.class))
.build().asJavaMap();
log.info("Started");
}
示例5: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
public void activate() {
appId = coreService.registerApplication(VPLS_APP);
intentInstaller = new IntentInstaller(appId,
intentService,
intentSynchronizer);
applicationService.registerDeactivateHook(appId, () -> {
intentSynchronizer.removeIntentsByAppId(appId);
});
hostService.addListener(hostListener);
interfaceService.addListener(interfaceListener);
setupConnectivity();
log.info("Started");
}
示例6: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
public void activate() {
log.info("Started");
alarms = storageService.<AlarmId, Alarm>consistentMapBuilder()
.withName("onos-alarm-table")
.withSerializer(Serializer.using(KryoNamespaces.API,
Alarm.class,
DefaultAlarm.class,
AlarmId.class,
AlarmEvent.Type.class,
Alarm.SeverityLevel.class,
AlarmEntityId.class))
.build();
alarms.addListener(listener);
alarmsMap = alarms.asJavaMap();
}
示例7: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
/**
* Active MulticastForwardingIntent.
*/
@Activate
public void activate() {
appId = coreService.registerApplication("org.onosproject.mfwd");
mcastIntentManager = new McastIntentManager();
mcastRouteManager.addListener(mcastIntentManager);
packetService.addProcessor(processor, PacketProcessor.director(2));
// Build a traffic selector for all multicast traffic
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
selector.matchEthType(Ethernet.TYPE_IPV4);
selector.matchIPDst(IpPrefix.IPV4_MULTICAST_PREFIX);
packetService.requestPackets(selector.build(), PacketPriority.REACTIVE, appId);
log.info("Started");
}
示例8: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
public void activate() {
providerService = providerRegistry.register(this);
controller.addListener(listener);
controller.addEventListener(listener);
for (OpenFlowSwitch sw : controller.getSwitches()) {
if (isGroupSupported(sw)) {
GroupStatsCollector gsc = new GroupStatsCollector(sw, POLL_INTERVAL);
gsc.start();
collectors.put(new Dpid(sw.getId()), gsc);
}
}
log.info("Started");
}
示例9: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
protected void activate() {
allocationMap = storageService.<HostId, IpAssignment>consistentMapBuilder()
.withName("onos-dhcp-assignedIP")
.withSerializer(Serializer.using(
new KryoNamespace.Builder()
.register(KryoNamespaces.API)
.register(IpAssignment.class,
IpAssignment.AssignmentStatus.class,
Date.class,
long.class,
Ip4Address.class)
.build()))
.build();
freeIPPool = storageService.<Ip4Address>setBuilder()
.withName("onos-dhcp-freeIP")
.withSerializer(Serializer.using(KryoNamespaces.API))
.build()
.asDistributedSet();
log.info("Started");
}
示例10: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
/**
* Activate the PIM component.
*/
@Activate
public void activate() {
// Get our application ID
appId = coreService.registerApplication("org.onosproject.pim");
// Build the traffic selector for PIM packets
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
selector.matchEthType(Ethernet.TYPE_IPV4);
selector.matchIPProtocol(IPv4.PROTOCOL_PIM);
// Use the traffic selector to tell the packet service which packets we want.
packetService.addProcessor(processor, PacketProcessor.director(5));
packetService.requestPackets(selector.build(), PacketPriority.CONTROL,
appId, Optional.empty());
// Get a copy of the PIM Packet Handler
pimPacketHandler = new PimPacketHandler();
log.info("Started");
}
示例11: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
protected void activate(ComponentContext context) throws IOException {
modified(context);
log.debug("Server starting on {}", listenPort);
try {
server = NettyServerBuilder.forPort(listenPort)
.addService(DeviceProviderRegistryRpcGrpc.bindService(new DeviceProviderRegistryServerProxy()))
.addService(LinkProviderServiceRpcGrpc.bindService(new LinkProviderServiceServerProxy(this)))
.build().start();
} catch (IOException e) {
log.error("Failed to start gRPC server", e);
throw e;
}
log.info("Started on {}", listenPort);
}
示例12: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
public void activate() {
eventHandler = Executors.newSingleThreadExecutor(
groupedThreads("onos/store/device/mastership", "event-handler", log));
messageHandlingExecutor =
Executors.newSingleThreadExecutor(
groupedThreads("onos/store/device/mastership", "message-handler", log));
transferExecutor =
Executors.newSingleThreadScheduledExecutor(
groupedThreads("onos/store/device/mastership", "mastership-transfer-executor", log));
clusterCommunicator.addSubscriber(ROLE_RELINQUISH_SUBJECT,
SERIALIZER::decode,
this::relinquishLocalRole,
SERIALIZER::encode,
messageHandlingExecutor);
localNodeId = clusterService.getLocalNode().id();
leadershipService.addListener(leadershipEventListener);
log.info("Started");
}
示例13: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
public void activate() {
appId = coreService.registerApplication(APP_NAME);
p2pIntentsFromHost = new ConcurrentHashMap<>();
p2pIntentsToHost = new ConcurrentHashMap<>();
privateIpAddressMap = new ConcurrentHashMap<>();
nextHopIpAddress = vbngConfigurationService.getNextHopIpAddress();
nodeToPort = vbngConfigurationService.getNodeToPort();
hostListener = new InternalHostListener();
hostService.addListener(hostListener);
log.info("vBNG Started");
// Recover the status before vBNG restarts
statusRecovery();
}
示例14: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
public void activate() {
KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
.register(KryoNamespaces.API)
.register(MultiValuedTimestamp.class);
tunnelIdAsKeyStore = storageService
.<TunnelId, Tunnel>eventuallyConsistentMapBuilder()
.withName("all_tunnel").withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
orderRelationship = storageService
.<ApplicationId, Set<TunnelSubscription>>eventuallyConsistentMapBuilder()
.withName("type_tunnel").withSerializer(serializer)
.withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
idGenerator = coreService.getIdGenerator(tunnelOpTopic);
tunnelIdAsKeyStore.addListener(tunnelUpdateListener);
log.info("Started");
}
示例15: activate
import org.apache.felix.scr.annotations.Activate; //导入依赖的package包/类
@Activate
protected void activate() {
appId = coreService.registerApplication(OPENSTACK_NODEMANAGER_ID);
localNodeId = clusterService.getLocalNode().id();
leadershipService.runForLeadership(appId.name());
nodeStore = storageService.<OpenstackNode, NodeState>consistentMapBuilder()
.withSerializer(Serializer.using(NODE_SERIALIZER.build()))
.withName(OPENSTACK_NODESTORE)
.withApplicationId(appId)
.build();
deviceService.addListener(deviceListener);
configRegistry.registerConfigFactory(configFactory);
configService.addListener(configListener);
readConfiguration();
log.info("Started");
}