OSGi 配置管理服务的现有实现?

发布于 2024-07-23 01:36:21 字数 532 浏览 8 评论 0原文

我们正在考虑使用配置管理服务作为主要 API,用于配置基于 OSGi 的应用程序中的组件。 如果我们可以重用一些现有的实现,那就太好了,所以我正在尝试调查和评估最受欢迎的实现。 我知道有:

是还有其他实施方案需要考虑吗?

此外,我找不到这些实现的任何好的文档。 我主要对特定于实现的细节感兴趣。 例如,我想知道不同的实现如何保留配置数据(例如多个属性文件?XML 文件?多个XML 文件?数据库?...)。

We are considering to use Configuration Admin Service as a primary API for configuring components in our OSGi-based application. It would be nice if we could reuse some existing implementation so I'm trying to investigate and evaluate the most popular ones. I know there is:

Are there any other implementations to be considered?

Also I was not able to find any good documentation for these implementations. I would be mainly interested in the implementation-specific details. For example I was wondering how different implementations persist the configuration data (e.g. multiple property files? XML file? multiple XML files? database?, ...).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

音栖息无 2024-07-30 01:36:21

Felix 的配置管理有一个 默认实现 持久保存到文件系统,但它们定义了一个服务接口 (org.apache.felix.cm.PersistenceManager)用于您可以插入的替代后端。

默认实现执行以下操作:

FilePersistenceManager 类将配置数据存储在
给定目录中类似属性的文件。 所有配置文件都是
位于同一目录中。

配置文件是通过附加在配置目录中创建的
配置的 PID 的扩展名“.config”。 PID
通过将括起来的点替换为斜杠将其转换为相对路径名。
PID 中的非符号名称字符用它们的值进行编码
十六进制的 Unicode 字符代码。

Felix's Configuration Admin has a default implementation that persists to the file system, but they define a service interface (org.apache.felix.cm.PersistenceManager) for alternative backends that you could plug in instead.

The default implementation does the following:

The FilePersistenceManager class stores configuration data in
properties-like files inside a given directory. All configuration files are
located in the same directory.

Configuration files are created in the configuration directory by appending
the extension ".config" to the PID of the configuration. The PID
is converted into a relative path name by replacing enclosed dots to slashes.
Non-symbolic-name characters in the PID are encoded with their
Unicode character code in hexadecimal.

归途 2024-07-30 01:36:21

我知道的三个公共实现是

Equinox 的实现ConfigurationAdmin 服务似乎并不像 Felix 那样支持对持久性策略的精细控制,并且 Knopflerfish 实现看起来(我只是简单地阅读了源代码)与 Equinox 类似。

Felix 似乎是最新更新且最可靠的。

目前我能找到的只有这些; 在 dm Server 上,我们决定使用 Felix 的捆绑包,现在可以从 SpringSource Enterprise Bundle Repository< /a>,您可以在其中快速搜索 Apache FelixConfigAdmin

The three public implementations I know of are

Equinox's implementation of the ConfigurationAdmin service appears not to support fine control over the persistence policy, as Felix's does, and the Knopflerfish implementation looks (I've only read the source briefly) similar to Equinox's.

The Felix one appears to be the most recently updated and the most reliable.

At present these are the only ones I can find; at dm Server we made the decision to use Felix's bundle, and this is now obtainable from the SpringSource Enterprise Bundle Repository, where you can quick-search for Apache Felix or ConfigAdmin.

眼眸 2024-07-30 01:36:21

只是为了进一步完成答案:我个人也更喜欢 Felix 实现。 有关如何使用 PersistenceManager 更改后端存储方式的示例,另请参阅 实现使用标准 Java 属性文件作为后备存储。 有一些限制,但至少允许您将配置与应用程序一起存储,并且与 OSGi 框架实现分开。

Just to complete the answer further: I personally also prefer the Felix implementation. For an example of how to change the way storage occurs at the back-end using a PersistenceManager, see also this implementation that uses standard Java property files as backing storage. Has some limitations, but at least allows you to store your configuration with your application and apart from your OSGi framework implementation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文