本文整理汇总了Java中org.osgi.service.component.annotations.Modified类的典型用法代码示例。如果您正苦于以下问题:Java Modified类的具体用法?Java Modified怎么用?Java Modified使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Modified类属于org.osgi.service.component.annotations包,在下文中一共展示了Modified类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: modified
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
Dictionary<?, ?> properties = context.getProperties();
int newTunnelStatsPollFrequency;
try {
String s = get(properties, "tunnelStatsPollFrequency");
newTunnelStatsPollFrequency = isNullOrEmpty(s) ? tunnelStatsPollFrequency : Integer.parseInt(s.trim());
} catch (NumberFormatException | ClassCastException e) {
newTunnelStatsPollFrequency = tunnelStatsPollFrequency;
}
if (newTunnelStatsPollFrequency != tunnelStatsPollFrequency) {
tunnelStatsPollFrequency = newTunnelStatsPollFrequency;
collectors.values().forEach(tsc -> tsc.adjustPollInterval(tunnelStatsPollFrequency));
log.info("New setting: tunnelStatsPollFrequency={}", tunnelStatsPollFrequency);
}
}
示例2: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
/**
* OSGi component lifecycle listener for actication and modification of this
* service.
*
* @param componentContext
* OSGi component context.
* @param properties
* OSGi configuration properties.
* @throws Exception
* is thrown if the activation or modification of the service
* goes wrong.
*/
@Activate
@Modified
protected void activate(ComponentContext componentContext, Map<String, Object> properties) throws Exception {
// Check if a service tracker for the context path exists and close it.
if (_serviceTracker != null) {
_serviceTracker.close();
}
// Create a filter for ServletContext components and start tracking.
Filter filter = FrameworkUtil
.createFilter("(&(objectClass=" + ServletContext.class.getName() + ")(osgi.web.contextpath=*))");
_serviceTracker = new ServiceTracker<>(componentContext.getBundleContext(), filter, this);
_serviceTracker.open();
}
示例3: modified
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Modified
public void modified(ComponentContext context) {
Dictionary<?, ?> properties = context.getProperties();
int newTunnelStatsPollFrequency;
try {
String s = get(properties, "tunnelStatsPollFrequency");
newTunnelStatsPollFrequency = isNullOrEmpty(s) ? tunnelStatsPollFrequency : Integer.parseInt(s.trim());
} catch (NumberFormatException | ClassCastException e) {
newTunnelStatsPollFrequency = tunnelStatsPollFrequency;
}
if (newTunnelStatsPollFrequency != tunnelStatsPollFrequency) {
tunnelStatsPollFrequency = newTunnelStatsPollFrequency;
collectors.values().forEach(tsc -> tsc.adjustPollInterval(tunnelStatsPollFrequency));
log.info("New setting: tunnelStatsPollFrequency={}", tunnelStatsPollFrequency);
}
}
示例4: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected final void activate(Configuration config) {
booleanProp = config.servicename_propertyname_boolean();
stringProp = config.servicename_propertyname_string();
dropdownProp = config.servicename_propertyname_dropdown();
stringArrayProp = config.servicename_propertyname_string_array();
passwordProp = config.servicename_propertyname_password().toCharArray();
longProp = config.servicename_propertyname_long();
}
示例5: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected void activate(Map<Object, Object> properties) {
_timetrackerConfiguration = ConfigurableUtil.createConfigurable(
TimetrackerConfiguration.class, properties);
}
示例6: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected void activate(Map<Object, Object> properties) {
_contactManagerConfiguration = ConfigurableUtil.createConfigurable(
ContactManagerConfiguration.class, properties);
}
示例7: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected void activate() {
schedulerEntryImpl.setTrigger(
TriggerFactoryUtil.createTrigger(getEventListenerClass(), getEventListenerClass(), 1, TimeUnit.MINUTE));
_schedulerEngineHelper.register(this, schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
}
示例8: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected void activate() {
schedulerEntryImpl.setTrigger(TriggerFactoryUtil.createTrigger(getEventListenerClass(), getEventListenerClass(),
45, TimeUnit.SECOND));
_schedulerEngineHelper.register(this, schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
}
示例9: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected void activate() {
schedulerEntryImpl.setTrigger(
TriggerFactoryUtil.createTrigger(getEventListenerClass(), getEventListenerClass(), 45, TimeUnit.SECOND));
_schedulerEngineHelper.register(this, schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
}
示例10: modified
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Modified
protected void modified(final Map<String, Object> properties) {
final Object value = properties.get("osgi.feature.myfeature");
if (value instanceof Boolean) {
isFeatureEnabled = (boolean) value;
}
doStuff();
}
示例11: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected void activate(Map<Object, Object> properties) {
_dataManagerConfiguration = ConfigurableUtil.createConfigurable(
DataManagerConfiguration.class, properties);
}
示例12: activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected void activate() {
schedulerEntryImpl.setTrigger(
TriggerFactoryUtil.createTrigger(
getEventListenerClass(), getEventListenerClass(), 15,
TimeUnit.MINUTE));
_schedulerEngineHelper.register(
this, schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
}
示例13: modified
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Modified
protected void modified(Map<String, Object> config) {
// We update instead of replace the configuration object, so that if the user updates the
// configuration, the values are automatically available in all handlers. Because they all
// share the same instance.
configuration.update(new Configuration(config).as(NetworkBindingConfiguration.class));
}
示例14: modified
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Override
@Modified
protected void modified(Map<String, Object> config) {
super.modified(config);
// We update instead of replace the configuration object, so that if the user updates the
// configuration, the values are automatically available in all handlers. Because they all
// share the same instance.
configuration.update(new Configuration(config).as(NetworkBindingConfiguration.class));
}
示例15: Activate
import org.osgi.service.component.annotations.Modified; //导入依赖的package包/类
@Activate
@Modified
protected void Activate(Configuration config) {
enabled = config.enabled();
}