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


Java Component類代碼示例

本文整理匯總了Java中org.apache.felix.scr.annotations.Component的典型用法代碼示例。如果您正苦於以下問題:Java Component類的具體用法?Java Component怎麽用?Java Component使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Component類屬於org.apache.felix.scr.annotations包,在下文中一共展示了Component類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: enableComponent

import org.apache.felix.scr.annotations.Component; //導入依賴的package包/類
private void enableComponent(String name) {
    org.apache.felix.scr.Component[] components = scrService.getComponents(name);

    if (components == null || components.length == 0) {
        return;
    }

    org.apache.felix.scr.Component component = components[0];

    if (component.getState() == org.apache.felix.scr.Component.STATE_DISABLED) {
        log.info("Enabling component {}", name);
        component.enable();
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:15,代碼來源:ComponentManager.java

示例2: disableComponent

import org.apache.felix.scr.annotations.Component; //導入依賴的package包/類
private void disableComponent(String name) {
    org.apache.felix.scr.Component[] components = scrService.getComponents(name);

    if (components == null || components.length == 0) {
        return;
    }

    log.info("Disabling component {}", name);

    components[0].disable();
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:12,代碼來源:ComponentManager.java

示例3: deactivate

import org.apache.felix.scr.annotations.Component; //導入依賴的package包/類
@Deactivate
public void deactivate() {
    log.info("CFM Web Component Stopped");
    codecService.unregisterCodec(MaintenanceDomain.class);
    codecService.unregisterCodec(MaintenanceAssociation.class);
    codecService.unregisterCodec(org.onosproject.incubator.net.l2monitoring.cfm.Component.class);
    codecService.unregisterCodec(VlanId.class);
    codecService.unregisterCodec(Mep.class);
    codecService.unregisterCodec(MepEntry.class);
    codecService.unregisterCodec(MepLbCreate.class);
    codecService.unregisterCodec(MepLbEntry.class);
    codecService.unregisterCodec(MepLtCreate.class);
    codecService.unregisterCodec(RemoteMepEntry.class);
    codecService.unregisterCodec(FngAddress.class);

    codecService.unregisterCodec(DelayMeasurementCreate.class);
    codecService.unregisterCodec(DelayMeasurementEntry.class);
    codecService.unregisterCodec(DelayMeasurementStat.class);
    codecService.unregisterCodec(DelayMeasurementStatCurrent.class);
    codecService.unregisterCodec(DelayMeasurementStatHistory.class);
    codecService.unregisterCodec(MeasurementOption.class);
    codecService.unregisterCodec(StartTime.class);
    codecService.unregisterCodec(StopTime.class);

    codecService.unregisterCodec(LossMeasurementCreate.class);
    codecService.unregisterCodec(LossMeasurementThreshold.class);
    codecService.unregisterCodec(LossMeasurementEntry.class);
    codecService.unregisterCodec(LossMeasurementStat.class);
    codecService.unregisterCodec(LossMeasurementStatCurrent.class);
    codecService.unregisterCodec(LossMeasurementStatHistory.class);
    codecService.unregisterCodec(LossAvailabilityStat.class);
    codecService.unregisterCodec(LossAvailabilityStatCurrent.class);
    codecService.unregisterCodec(LossAvailabilityStatHistory.class);
    codecService.unregisterCodec(CounterOption.class);
    codecService.unregisterCodec(ThresholdOption.class);

}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:38,代碼來源:CfmWebComponent.java

示例4: disable

import org.apache.felix.scr.annotations.Component; //導入依賴的package包/類
@Override
public void disable(String componentName) {
    for (org.apache.felix.scr.Component component : scr.getComponents(componentName)) {
        if (component.getState() != org.apache.felix.scr.Component.STATE_DISABLED) {
            log.info("Component {} disabled by configuration (pid={}) ", component.getClassName(),
                    component.getConfigurationPid());
            component.disable();
        }
    }
}
 
開發者ID:Adobe-Consulting-Services,項目名稱:acs-aem-commons,代碼行數:11,代碼來源:ComponentDisablerDriverFelix.java

示例5: activate

import org.apache.felix.scr.annotations.Component; //導入依賴的package包/類
@Activate
public void activate() {
    maintenanceDomainConsistentMap = storageService
            .<MdId, MaintenanceDomain>consistentMapBuilder()
            .withName("onos-cfm-ma-map")
            .withSerializer(Serializer.using(new KryoNamespace.Builder()
                    .register(KryoNamespaces.API)
                    .register(DefaultMaintenanceDomain.class)
                    .register(MdIdCharStr.class)
                    .register(MdIdDomainName.class)
                    .register(MdIdMacUint.class)
                    .register(MdIdNone.class)
                    .register(MaintenanceDomain.MdLevel.class)
                    .register(DefaultMaintenanceAssociation.class)
                    .register(MaIdCharStr.class)
                    .register(MaIdShort.class)
                    .register(MaId2Octet.class)
                    .register(MaIdIccY1731.class)
                    .register(MaIdPrimaryVid.class)
                    .register(MaIdRfc2685VpnId.class)
                    .register(MaintenanceAssociation.CcmInterval.class)
                    .register(DefaultComponent.class)
                    .register(MepId.class)
                    .register(Identifier.class)
                    .register(InternetDomainName.class)
                    .register(MacAddress.class)
                    .register(ImmutablePair.class)
                    .register(org.onosproject.incubator.net.l2monitoring
                                        .cfm.Component.MhfCreationType.class)
                    .register(org.onosproject.incubator.net.l2monitoring
                                        .cfm.Component.IdPermissionType.class)
                    .register(org.onosproject.incubator.net.l2monitoring
                                        .cfm.Component.TagType.class)
                    .build("md")))
            .build();
    mapListener = new InternalMdListener();
    maintenanceDomainConsistentMap.addListener(mapListener);

    maintenanceDomainMap = maintenanceDomainConsistentMap.asJavaMap();
    log.info("MDStore started");
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:42,代碼來源:DistributedMdStore.java

示例6: activate

import org.apache.felix.scr.annotations.Component; //導入依賴的package包/類
@Activate
public void activate() {
    codecService.registerCodec(MaintenanceDomain.class,
                                    new MaintenanceDomainCodec());
    codecService.registerCodec(MaintenanceAssociation.class,
                                    new MaintenanceAssociationCodec());
    codecService.registerCodec(org.onosproject.incubator.net.l2monitoring.cfm.Component.class,
                                    new ComponentCodec());
    codecService.registerCodec(VlanId.class, new VidCodec());
    codecService.registerCodec(Mep.class, new MepCodec());
    codecService.registerCodec(MepEntry.class, new MepEntryCodec());
    codecService.registerCodec(MepLbCreate.class, new MepLbCreateCodec());
    codecService.registerCodec(MepLbEntry.class, new MepLbEntryCodec());
    codecService.registerCodec(MepLtCreate.class, new MepLtCreateCodec());
    codecService.registerCodec(RemoteMepEntry.class, new RemoteMepEntryCodec());
    codecService.registerCodec(FngAddress.class, new FngAddressCodec());


    codecService.registerCodec(DelayMeasurementCreate.class,
                                    new DmCreateCodec());
    codecService.registerCodec(DelayMeasurementEntry.class,
                                    new DmEntryCodec());
    codecService.registerCodec(DelayMeasurementStat.class,
                                    new DelayMeasurementStatCodec());
    codecService.registerCodec(DelayMeasurementStatCurrent.class,
                                    new DelayMeasurementStatCurrentCodec());
    codecService.registerCodec(DelayMeasurementStatHistory.class,
                                    new DelayMeasurementStatHistoryCodec());
    codecService.registerCodec(MeasurementOption.class,
                                    new DmMeasurementOptionCodec());

    codecService.registerCodec(LossMeasurementCreate.class,
                                    new LmCreateCodec());
    codecService.registerCodec(LossMeasurementThreshold.class,
                                    new LossMeasurementThresholdCodec());
    codecService.registerCodec(LossMeasurementEntry.class,
                                    new LmEntryCodec());
    codecService.registerCodec(LossMeasurementStat.class,
                                    new LossMeasurementStatCodec());
    codecService.registerCodec(LossMeasurementStatCurrent.class,
                                    new LossMeasurementStatCurrentCodec());
    codecService.registerCodec(LossMeasurementStatHistory.class,
                                    new LossMeasurementStatHistoryCodec());
    codecService.registerCodec(LossAvailabilityStat.class,
                                    new LossAvailabilityStatCodec());
    codecService.registerCodec(LossAvailabilityStatCurrent.class,
                                    new LossAvailabilityStatCurrentCodec());
    codecService.registerCodec(LossAvailabilityStatHistory.class,
                                    new LossAvailabilityStatHistoryCodec());
    codecService.registerCodec(CounterOption.class,
                                    new LmCounterOptionCodec());
    codecService.registerCodec(ThresholdOption.class,
                                    new LmThresholdOptionCodec());

    codecService.registerCodec(StartTime.class, new StartTimeCodec());
    codecService.registerCodec(StopTime.class, new StopTimeCodec());

    log.info("CFM Web Component Started");
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:60,代碼來源:CfmWebComponent.java

示例7: getDDEditBlock

import org.apache.felix.scr.annotations.Component; //導入依賴的package包/類
@SuppressWarnings("squid:S3776")
public String getDDEditBlock(SlingHttpServletRequest request, String name,
        ComponentEditType.Type editType, boolean... isConfigured) {
    if (!isAuthoringMode(request) || conditionAndCheck(isConfigured)) {
        return null;
    }

    final Resource resource = request.getResource();
    final com.day.cq.wcm.api.components.Component component = WCMUtils.getComponent(resource);

    StringBuilder html = new StringBuilder();

    ComponentEditConfig editConfig = component.getEditConfig();
    Map<String, DropTarget> dropTargets = (editConfig != null) ? editConfig.getDropTargets() : null;

    if (dropTargets != null && !dropTargets.isEmpty()) {
        DropTarget dropTarget = null;

        // Find the named Drop Target
        for (final Map.Entry<String, DropTarget> entry : dropTargets.entrySet()) {
            dropTarget = entry.getValue();
            if (StringUtils.equals(name, dropTarget.getName())) {
                break;
            } else {
                dropTarget = null;
            }
        }

        if (dropTarget != null) {
            // If editType has not been specified then intelligently determine the best match
            editType = (editType == null) ? getWCMEditType(dropTarget) : editType;

            String classNames = dropTarget.getId() + " " + editType.getCssClass();
            String placeholderTitle = "Drop Target: " + dropTarget.getName();

            html.append(generateClassicUIPlaceholder(classNames, placeholderTitle));
        }
    }

    return html.toString();
}
 
開發者ID:Adobe-Consulting-Services,項目名稱:acs-aem-commons,代碼行數:42,代碼來源:ComponentHelperImpl.java


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