【问题标题】:Store variables out of the bundle in osgi将变量存储在 osgi 中
【发布时间】:2017-04-04 17:50:48
【问题描述】:

我有一个关于 OSGI 捆绑包中的蓝图的问题。我将 activiti 捆绑在一起,但是必须在蓝图中进行一些配置才能使其工作。我不想每次更改这些设置时都编译新的捆绑包。是否可以将它们存储在蓝图中以更改它只需要重新启动捆绑包?

 <bean id="configuration" class="org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration"
      ext:field-injection="true">
    <property name="databaseType" value="h2"/>
    <property name="dataSource" ref="dataSource"/>
    <property name="transactionManager" ref="transactionManager"/>
    <property name="databaseSchemaUpdate" value="true"/>
    <property name="transactionsExternallyManaged" value="true"/>
    <property name="defaultCamelContext" value="defaultContext"/>
    <property name="mailServerHost" value="smtp.googlemail.com"/>
    <property name="mailServerUsername" value="xxxx"/>
    <property name="mailServerPassword" value="xxxx"/>
    <property name="mailServerPort" value="465"/>
    <property name="useSSL" value="true" />
    <property name="useTLS" value="true" />
    <property name="mailServerDefaultFrom" value="senderadress"/>
</bean>

非常感谢!

【问题讨论】:

    标签: osgi activiti osgi-bundle blueprint-osgi


    【解决方案1】:

    在 OSGi 中,您使用配置管理规范进行配置。在 Apache Karaf 中,它允许将配置存储在 etc 目录中的文件中。

    要将它们注入蓝图,请使用 blueprint-cm 命名空间。 See this tutorial怎么用。

    【讨论】:

      猜你喜欢
      • 2021-06-22
      • 2013-04-18
      • 2013-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-24
      • 2017-07-11
      • 2011-12-10
      相关资源
      最近更新 更多