当前位置: 首页>>代码示例>>Java>>正文


Java Modified类代码示例

本文整理汇总了Java中org.apache.felix.scr.annotations.Modified的典型用法代码示例。如果您正苦于以下问题:Java Modified类的具体用法?Java Modified怎么用?Java Modified使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Modified类属于org.apache.felix.scr.annotations包,在下文中一共展示了Modified类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: activate

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected final void activate(final Map<String, Object> config) {
    Map<String, Object> properties = Collections.emptyMap();

    if (config != null) {
        properties = config;
    }

    booleanProp = PropertiesUtil.toBoolean(properties.get(BOOLEAN_PROPERTY_NAME), BOOLEAN_PROPERTY_DEFAULT_VALUE);
    stringProp = PropertiesUtil.toString(properties.get(STRING_PROPERTY_NAME), STRING_PROPERTY_DEFAULT_VALUE);
    dropdownProp = PropertiesUtil.toString(properties.get(DROPDOWN_PROPERTY_NAME), DROPDOWN_PROPERTY_DEFAULT_VALUE);
    stringArrayProp = PropertiesUtil.toStringArray(properties.get(STRING_ARRAY_PROPERTY_NAME));
    passwordProp = PropertiesUtil.toString(properties.get(PASSWORD_PROPERTY_NAME), "").toCharArray();
    longProp = PropertiesUtil.toLong(properties.get(LONG_PROPERTY_NAME), LONG_PROPERTY_DEFAULT_VALUE);
}
 
开发者ID:nateyolles,项目名称:aem-osgi-annotation-demo,代码行数:17,代码来源:SampleFelixServiceImpl.java

示例2: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    if (context == null) {
        netconfReplyTimeout = DEFAULT_REPLY_TIMEOUT_SECONDS;
        log.info("No component configuration");
        return;
    }

    Dictionary<?, ?> properties = context.getProperties();

    int newNetconfReplyTimeout;
    try {
        String s = get(properties, PROP_NETCONF_REPLY_TIMEOUT);
        newNetconfReplyTimeout = isNullOrEmpty(s) ?
                netconfReplyTimeout : Integer.parseInt(s.trim());
    } catch (NumberFormatException e) {
        log.warn("Component configuration had invalid value", e);
        return;
    }

    netconfReplyTimeout = newNetconfReplyTimeout;
    log.info("Settings: {} = {}", PROP_NETCONF_REPLY_TIMEOUT, netconfReplyTimeout);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:NetconfControllerImpl.java

示例3: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
protected void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    String updatedUrl;

    updatedUrl = Tools.get(properties, VTN_SERVICE_URL);
    if (!Strings.isNullOrEmpty(updatedUrl) && !updatedUrl.equals(vtnServiceUrl)) {
        vtnServiceUrl = updatedUrl;
        vtnServiceApi = new DefaultVtnServiceApi(vtnServiceUrl, access);
    }

   updatedUrl = Tools.get(properties, VTN_PORT_URL);
    if (!Strings.isNullOrEmpty(updatedUrl) && !updatedUrl.equals(vtnPortUrl)) {
        vtnPortUrl = updatedUrl;
        vtnPortApi = new DefaultVtnPortApi(vtnPortUrl, access);
    }

    log.info("Modified");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:XosClient.java

示例4: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
protected void modified(ComponentContext context) {
    log.info("Received configuration change...");
    Dictionary<?, ?> properties = context != null ? context.getProperties() : new Properties();
    String newIp = get(properties, "aliasIp");
    String newMask = get(properties, "aliasMask");
    String newAdapter = get(properties, "aliasAdapter");

    // Process any changes in the parameters...
    if (!Objects.equals(newIp, aliasIp) ||
            !Objects.equals(newMask, aliasMask) ||
            !Objects.equals(newAdapter, aliasAdapter)) {
        synchronized (this) {
            log.info("Reconfiguring with aliasIp={}, aliasMask={}, aliasAdapter={}, wasLeader={}",
                     newIp, newMask, newAdapter, wasLeader);
            if (wasLeader) {
                removeIpAlias(aliasIp, aliasMask, aliasAdapter);
                addIpAlias(newIp, newMask, newAdapter);
            }
            aliasIp = newIp;
            aliasMask = newMask;
            aliasAdapter = newAdapter;
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:ClusterIpManager.java

示例5: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    int newRate = DEFAULT_RATE;
    if (context != null) {
        Dictionary properties = context.getProperties();
        try {
            String s = get(properties, "rate");
            newRate = isNullOrEmpty(s)
                    ? rate : Integer.parseInt(s.trim());
        } catch (Exception e) {
            return;
        }
    }
    if (newRate != rate) {
        log.info("Per node rate changed to {}", newRate);
        rate = newRate;
        stopTest();
        runner.execute(this::startTest);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:DistributedConsensusLoadTest.java

示例6: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    if (context == null) {
        log.info("Settings: useFlowObjectives={}", useFlowObjectives);
        return;
    }

    boolean newFlowObjectives;
    try {
        String s = Tools.get(context.getProperties(), "useFlowObjectives");
        newFlowObjectives = isNullOrEmpty(s) ? useFlowObjectives : Boolean.parseBoolean(s.trim());
    } catch (ClassCastException e) {
        newFlowObjectives = useFlowObjectives;
    }

    if (useFlowObjectives != newFlowObjectives) {
        useFlowObjectives = newFlowObjectives;
        changeCompilers();
        log.info("Settings: useFlowObjectives={}", useFlowObjectives);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:IntentConfigurableRegistrator.java

示例7: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context != null ? context.getProperties() : new Properties();

    int newMessageHandlerThreadPoolSize;

    try {
        String s = get(properties, "messageHandlerThreadPoolSize");

        newMessageHandlerThreadPoolSize =
                isNullOrEmpty(s) ? messageHandlerThreadPoolSize : Integer.parseInt(s.trim());

    } catch (NumberFormatException e) {
        log.warn(e.getMessage());
        newMessageHandlerThreadPoolSize = messageHandlerThreadPoolSize;
    }

    // Any change in the following parameters implies thread pool restart
    if (newMessageHandlerThreadPoolSize != messageHandlerThreadPoolSize) {
        setMessageHandlerThreadPoolSize(newMessageHandlerThreadPoolSize);
        restartMessageHandlerThreadPool();
    }

    log.info(FORMAT, messageHandlerThreadPoolSize);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:DistributedStatisticStore.java

示例8: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
protected void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();

    String newLinkWeightFunction = get(properties, "linkWeightFunction");
    if (newLinkWeightFunction != null &&
            !Objects.equals(newLinkWeightFunction, linkWeightFunction)) {
        linkWeightFunction = newLinkWeightFunction;
        LinkWeight weight = linkWeightFunction.equals(LINK_METRIC) ?
                new MetricLinkWeight() :
                linkWeightFunction.equals(GEO_DISTANCE) ?
                        new GeoDistanceLinkWeight(deviceService) : null;
        setDefaultLinkWeight(weight);
    }
    log.info(FORMAT, linkWeightFunction);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:DistributedTopologyStore.java

示例9: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context != null ? context.getProperties() : new Properties();

    try {
        String s = get(properties, "defaultVlan");
        defaultVlan = isNullOrEmpty(s) ? DEFAULT_VLAN : Integer.parseInt(s.trim());

        Boolean o = Tools.isPropertyEnabled(properties, "enableDhcpIgmpOnProvisioning");
        if (o != null) {
            enableDhcpIgmpOnProvisioning = o;
        }
    } catch (Exception e) {
        defaultVlan = DEFAULT_VLAN;
    }
}
 
开发者ID:opencord,项目名称:olt,代码行数:17,代码来源:Olt.java

示例10: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public boolean modified(ComponentContext context) {
    if (context == null) {
        log.info("No configuration change, using defaults: pktRate={}",
                DEFAULT_RATE);
        return false;
    }
    Dictionary<?, ?> properties = context.getProperties();

    int newRate;
    try {
        String s = String.valueOf(properties.get("pktRate"));
        newRate = isNullOrEmpty(s) ? pktRate : Integer.parseInt(s.trim());
    } catch (NumberFormatException | ClassCastException e) {
        log.warn(e.getMessage());
        newRate = pktRate;
    }

    if (newRate != pktRate) {
        pktRate = newRate;
        packetDriver.submit(new PacketDriver());
        log.info("Using new settings: pktRate={}", pktRate);
        return true;
    }
    return false;
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:27,代码来源:NullPacketProvider.java

示例11: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    if (context == null) {
        loadSuppressionRules();
        return;
    }
    @SuppressWarnings("rawtypes")
    Dictionary properties = context.getProperties();

    String s = get(properties, PROP_DISABLE_LD);
    if (!Strings.isNullOrEmpty(s)) {
        disableLinkDiscovery = Boolean.valueOf(s);
    }
    s = get(properties, PROP_USE_BDDP);
    if (!Strings.isNullOrEmpty(s)) {
        useBDDP = Boolean.valueOf(s);
    }
    s = get(properties, PROP_LLDP_SUPPRESSION);
    if (!Strings.isNullOrEmpty(s)) {
        lldpSuppression = s;
    }

    loadSuppressionRules();
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:25,代码来源:LLDPLinkProvider.java

示例12: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    Dictionary<?, ?> properties = context.getProperties();
    Integer sharedThreadPoolSizeConfig =
            getIntegerProperty(properties, "sharedThreadPoolSize");
    if (sharedThreadPoolSizeConfig == null) {
        log.info("Shared Pool Size is not configured, default value is {}",
                sharedThreadPoolSize);
    } else {
        if (sharedThreadPoolSizeConfig > 0) {
            sharedThreadPoolSize = sharedThreadPoolSizeConfig;
            SharedExecutors.setPoolSize(sharedThreadPoolSize);
            log.info("Configured. Shared Pool Size is configured to {}",
                    sharedThreadPoolSize);
        } else {
            log.warn("Shared Pool Size size must be greater than 0");
        }
    }
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:20,代码来源:CoreManager.java

示例13: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
void modified(Map<String, Object> configuration) throws Exception {
    ZookeeperConfig config = new ZookeeperConfig();
    configurer.configure(configuration, this);
    configurer.configure(configuration, config);

    if (!StringUtils.isNullOrBlank(config.getZookeeperUrl())) {
        State prev = state.get();
        ZookeeperConfig oldConfiguration = prev != null ? prev.configuration : null;
        if (!config.equals(oldConfiguration)) {
            State next = new State(config);
            if (state.compareAndSet(prev, next)) {
                executor.submit(next);
                if (prev != null) {
                    prev.close();
                }
            } else {
                next.close();
            }
        }
    }
}
 
开发者ID:tdiesler,项目名称:fabric8poc,代码行数:23,代码来源:ManagedCuratorFramework.java

示例14: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    if (context != null) {
        Dictionary<?, ?> properties = context.getProperties();
        pollFrequency = Tools.getIntegerProperty(properties, "pollFrequency",
                DEFAULT_POLL_FREQUENCY_SECONDS);
        log.info("Configured. Poll frequency is configured to {} seconds", pollFrequency);
    }

    if (!scheduledTasks.isEmpty()) {
        //cancel all previous tasks
        scheduledTasks.values().forEach(task -> task.cancel(false));
        //resubmit task with new timeout.
        Set<DeviceId> deviceSubjects =
                cfgService.getSubjects(DeviceId.class, GeneralProviderDeviceConfig.class);
        deviceSubjects.forEach(deviceId -> {
            if (!compareScheme(deviceId)) {
                // not under my scheme, skipping
                log.debug("{} is not my scheme, skipping", deviceId);
                return;
            }
            scheduledTasks.put(deviceId, schedulePolling(deviceId, true));
        });
    }

}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:27,代码来源:GeneralDeviceProvider.java

示例15: modified

import org.apache.felix.scr.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
    if (context != null) {
        Dictionary<?, ?> properties = context.getProperties();
        pollFrequency = Tools.getIntegerProperty(properties, "pollFrequency",
                                                 DEFAULT_POLL_FREQUENCY_SECONDS);
        log.info("Configured. Poll frequency is configured to {} seconds", pollFrequency);

        maxRetries = Tools.getIntegerProperty(properties, "maxRetries",
                DEFAULT_MAX_RETRIES);
        log.info("Configured. Number of retries is configured to {} times", maxRetries);
    }
    if (scheduledTask != null) {
        scheduledTask.cancel(false);
    }
    scheduledTask = schedulePolling();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:18,代码来源:NetconfDeviceProvider.java


注:本文中的org.apache.felix.scr.annotations.Modified类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。