本文整理匯總了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();
}