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