當前位置: 首頁>>代碼示例>>Java>>正文


Java Activate類代碼示例

本文整理匯總了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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:22,代碼來源:PartitionManager.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:20,代碼來源:OpticalPathProvisioner.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:21,代碼來源:UiSharedTopologyModel.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:26,代碼來源:SubnetManager.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:20,代碼來源:Vpls.java

示例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();
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:17,代碼來源:DistributedAlarmStore.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:22,代碼來源:McastForwarding.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:17,代碼來源:OpenFlowGroupProvider.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:24,代碼來源:DistributedDhcpStore.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:25,代碼來源:PimApplication.java

示例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);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:18,代碼來源:GrpcRemoteServiceServer.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:23,代碼來源:ConsistentDeviceMastershipStore.java

示例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();
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:18,代碼來源:VbngManager.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:18,代碼來源:DistributedTunnelStore.java

示例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");
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:20,代碼來源:OpenstackNodeManager.java


注:本文中的org.apache.felix.scr.annotations.Activate類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。