热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.osgi.service.cm.Configuration.delete()方法的使用及代码示例

本文整理了Java中org.osgi.service.cm.Configuration.delete()方法的一些代码示例,展示了Configuration

本文整理了Java中org.osgi.service.cm.Configuration.delete()方法的一些代码示例,展示了Configuration.delete()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.delete()方法的具体详情如下:
包路径:org.osgi.service.cm.Configuration
类名称:Configuration
方法名:delete

Configuration.delete介绍

[英]Delete this Configuration object.

Removes this configuration object from the persistent store. Notify asynchronously the corresponding Managed Service or Managed Service Factory. A ManagedService object is notified by a call to its updated method with a null properties argument. A ManagedServiceFactory object is notified by a call to its deleted method.

Also notifies all Configuration Listeners with a ConfigurationEvent#CM_DELETED event.
[中]删除此配置对象。
从持久存储中删除此配置对象。异步通知相应的托管服务或托管服务工厂。ManagedService对象通过调用其更新的方法(带有null properties参数)得到通知。对ManagedServiceFactory对象的已删除方法的调用会通知该对象。
还使用ConfigurationEvent#CM#U DELETED事件通知所有配置侦听器。

代码示例

代码示例来源:origin: apache/felix

/**
* @see org.osgi.service.cm.Configuration#delete()
*/
public void delete() throws Exception {
server.unregisterMBean(oname);
configuration.delete();
}

代码示例来源:origin: io.fabric8.mq/mq-fabric

@Deactivate
void deactivate() throws IOException {
if( config!=null ) {
try
{
config.delete();
}
catch (IllegalStateException ignore) {
}
}
}

代码示例来源:origin: apache/karaf

@Override
public void delete(String pid) throws Exception {
LOGGER.trace("Deleting configuration {}", pid);
Configuration cOnfiguration= configAdmin.getConfiguration(pid, null);
configuration.delete();
}

代码示例来源:origin: apache/karaf

@Override
public void delete(String name) throws Exception {
String filter = String.format("(&(service.factoryPid=org.ops4j.connectionfactory)(%s=%s))", ConnectionFactoryFactory.JMS_CONNECTIONFACTORY_NAME, name);
Configuration[] cOnfigs= configAdmin.listConfigurations(filter);
for (Configuration config : configs) {
config.delete();
}
}

代码示例来源:origin: apache/karaf

@Override
public void delete(String name) throws Exception {
String filter = String.format("(&(service.factoryPid=org.ops4j.datasource)(%s=%s))", DataSourceFactory.JDBC_DATASOURCE_NAME, name);
Configuration[] cOnfigs= configAdmin.listConfigurations(filter);
for (Configuration config : configs) {
config.delete();
}
}

代码示例来源:origin: org.apache.karaf.jdbc/org.apache.karaf.jdbc.core

@Override
public void delete(String name) throws Exception {
String filter = String.format("(&(service.factoryPid=org.ops4j.datasource)(%s=%s))", DataSourceFactory.JDBC_DATASOURCE_NAME, name);
Configuration[] cOnfigs= configAdmin.listConfigurations(filter);
for (Configuration config : configs) {
config.delete();
}
}

代码示例来源:origin: org.apache.jclouds.karaf/commands

@Override
protected Object doExecute() throws Exception {
Configuration cOnfiguration= findOrCreateFactoryConfiguration(configAdmin, "org.jclouds.compute", id, null, null);
if (configuration != null) {
configuration.delete();
} else {
System.out.println("No service found for provider / api");
}
return null;
}

代码示例来源:origin: org.apache.karaf.config/org.apache.karaf.config.core

@Override
public void delete(String pid) throws Exception {
LOGGER.trace("Deleting configuration {}", pid);
Configuration cOnfiguration= configAdmin.getConfiguration(pid, null);
configuration.delete();
}

代码示例来源:origin: org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.config

public void delete(String pid) throws Exception {
Configuration cOnfiguration= configurationAdmin.getConfiguration(pid, null);
if (cOnfiguration== null) {
throw new IllegalArgumentException("Configuration PID " + pid + " doesn't exist");
}
configuration.delete();
if (storage != null) {
File cfgFile = new File(storage, pid + ".cfg");
cfgFile.delete();
}
}

代码示例来源:origin: org.apache.sling/org.apache.sling.distribution.core

private void deleteOsgiConfigs(List configurations) {
for (Configuration configuration : configurations) {
String pid = configuration.getPid();
try {
configuration.delete();
log.info("Deleted configuration {}", pid);
} catch (IOException e) {
log.warn("Cannot delete configuration {}", pid, e);
}
}
}

代码示例来源:origin: org.osgi/osgi.enroute.iot.circuit.provider

/**
* Remove an existing wire
*/
@Override
public boolean disconnect(int wireId) throws Exception {
Configuration[] list = cm.listConfigurations("(wireId=" + wireId + ")");
if (list == null || list.length == 0)
return false;
list[0].delete();
return true;
}

代码示例来源:origin: apache/karaf

void deleteServiceGuardConfig(String originatingPid, String scope) throws IOException, InvalidSyntaxException {
if (scope.contains("."))
// This is not a command scope as that should be a single word without any further dots
return;
// Delete all the generated configurations for this scope
Configuration[] cOnfigs= configAdmin.listConfigurations("(service.pid=" + PROXY_SERVICE_ACL_PID_PREFIX + scope + ".*)");
if (cOnfigs== null)
return;
LOGGER.info("Config ACL deleted: {}. Deleting generated service ACL configs {}", originatingPid, configs);
for (Configuration config : configs) {
config.delete();
}
}

代码示例来源:origin: osgi/osgi.enroute.examples

/**
* Remove a configuration.
*
* @param pid
* the (instance) PID of a configuration
*/
public void removeConfiguration(String pid) throws IOException {
cm.getConfiguration(pid, "?").delete();
}

代码示例来源:origin: io.snamp/internal-services

@Override
final void removeAll(final ConfigurationAdmin admin) throws IOException {
getConfig(admin).delete();
}

代码示例来源:origin: org.apache.jclouds.karaf/commands

@Override
protected Object doExecute() throws Exception {
if (id == null) {
System.err.println("You need to either specify the service id.");
return null;
}
Configuration cOnfiguration= findOrCreateFactoryConfiguration(configAdmin, "org.jclouds.blobstore", id, null, null);
if (configuration != null) {
configuration.delete();
} else {
System.out.println("No service found for provider / api");
}
return null;
}

代码示例来源:origin: apache/jackrabbit-oak

public void removeConfigs(Set pidsToBeRemoved) throws Exception {
for (String pidString : pidsToBeRemoved) {
String[] pid = parsePid(pidString);
Configuration cOnfig= getConfiguration(pidString, pid[0], pid[1]);
config.delete();
}
if (!pidsToBeRemoved.isEmpty()) {
log.info("Configuration belonging to following pids have been removed {}", pidsToBeRemoved);
}
}

代码示例来源:origin: openhab/openhab-core

/**
* Deletes a configuration for a config id.
*
* @param configId config id
* @return old config or null if no old config existed
* @throws IOException if configuration can not be removed
*/
public Configuration delete(String configId) throws IOException {
org.osgi.service.cm.Configuration serviceCOnfiguration= configurationAdmin.getConfiguration(configId, null);
Configuration oldCOnfiguration= toConfiguration(serviceConfiguration.getProperties());
serviceConfiguration.delete();
return oldConfiguration;
}

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.filemonitor

protected void deleteConfiguration(File file) throws IOException, InvalidSyntaxException {
String[] pid = parsePid(file);
Configuration cOnfig= getConfiguration(pid[0], pid[1]);
config.delete();
}

代码示例来源:origin: io.fabric8.mq/mq-fabric

@Activate
void activate(Map configuration) throws Exception {
Properties properties = toProperties(configuration);
// Make sure the original config we are linked to still exists.
if( !BrokerDeployment.LOAD_TS.equals(properties.getProperty("mq.fabric.server.ts") ) ) {
// Our pid is now stale.
Configuration ourCOnfig= getConfigurationAdmin().getConfiguration(properties.getProperty("service.pid"));
ourConfig.delete();
} else {
pid = properties.getProperty("service.pid");
getBrokerDeploymentManager().updated(pid, properties);
}
}

代码示例来源:origin: de.dentrassi.osgi/net.luminis.cmc

@Descriptor("deletes configuration for service")
public void delete(@Descriptor("The PID to delete") final String pid) throws IOException {
final Configuration cOnfiguration= findConfiguration(this.configAdmin, pid);
if (configuration != null) {
configuration.delete();
} else {
System.out.format("no configuration for pid '%s'", pid);
}
}
}

推荐阅读
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • Python爬虫中使用正则表达式的方法和注意事项
    本文介绍了在Python爬虫中使用正则表达式的方法和注意事项。首先解释了爬虫的四个主要步骤,并强调了正则表达式在数据处理中的重要性。然后详细介绍了正则表达式的概念和用法,包括检索、替换和过滤文本的功能。同时提到了re模块是Python内置的用于处理正则表达式的模块,并给出了使用正则表达式时需要注意的特殊字符转义和原始字符串的用法。通过本文的学习,读者可以掌握在Python爬虫中使用正则表达式的技巧和方法。 ... [详细]
  • 本文介绍了OpenStack的逻辑概念以及其构成简介,包括了软件开源项目、基础设施资源管理平台、三大核心组件等内容。同时还介绍了Horizon(UI模块)等相关信息。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • 本文介绍了C#中生成随机数的三种方法,并分析了其中存在的问题。首先介绍了使用Random类生成随机数的默认方法,但在高并发情况下可能会出现重复的情况。接着通过循环生成了一系列随机数,进一步突显了这个问题。文章指出,随机数生成在任何编程语言中都是必备的功能,但Random类生成的随机数并不可靠。最后,提出了需要寻找其他可靠的随机数生成方法的建议。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • [大整数乘法] java代码实现
    本文介绍了使用java代码实现大整数乘法的过程,同时也涉及到大整数加法和大整数减法的计算方法。通过分治算法来提高计算效率,并对算法的时间复杂度进行了研究。详细代码实现请参考文章链接。 ... [详细]
  • 前景:当UI一个查询条件为多项选择,或录入多个条件的时候,比如查询所有名称里面包含以下动态条件,需要模糊查询里面每一项时比如是这样一个数组条件:newstring[]{兴业银行, ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • Go GUIlxn/walk 学习3.菜单栏和工具栏的具体实现
    本文介绍了使用Go语言的GUI库lxn/walk实现菜单栏和工具栏的具体方法,包括消息窗口的产生、文件放置动作响应和提示框的应用。部分代码来自上一篇博客和lxn/walk官方示例。文章提供了学习GUI开发的实际案例和代码示例。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • Imtryingtofigureoutawaytogeneratetorrentfilesfromabucket,usingtheAWSSDKforGo.我正 ... [详细]
author-avatar
wodewodewoe
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有