首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >springDM配置管理批量属性更改

springDM配置管理批量属性更改
EN

Stack Overflow用户
提问于 2012-02-29 20:14:23
回答 1查看 208关注 0票数 0

因此,我有springDM托管属性

代码语言:javascript
复制
<beans:beans xmlns="http://www.springframework.org/schema/osgi-compendium"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
xsi:schemaLocation="
  http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/osgi-compendium 
    http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">

<beans:bean id="configurationBean" class="com.eugene.PropertiesBean">
    <osgix:managed-properties persistent-id="MyPid" update-strategy="container-managed"/>
    <beans:property name="host" value="localhost"></beans:property>
    <beans:property name="port" value="5698"></beans:property>
</beans:bean>
</beans:beans>

现在,这就是我要做的。将捆绑包部署到Virgo,一切正常,默认属性(因为没有部署MyPid.properties )被注入到bean中。

在主机和端口都更改的情况下部署MyPid.properties,它们也都会重新注入。

太好了。但问题是,我能用一个方法来告诉我bean已经改变了吗?属性被重新注入了吗?类似于: afterPropertiesSet或init in XML config?因为现在afterPropertiesSet或init只在第一次注入属性时起作用,而不是第二次、第三次等等……这是某种逻辑。

我不知道(谷歌搜索) spring DM是否提供了这样的东西。

谢谢!尤金。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-03-02 16:07:13

这实际上是一个已知的问题。我们不得不切换到bean管理的更新。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9498991

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档