1

所以我正在寻找 CDI 属性注入,我正在寻找 DeltaSpike

http://deltaspike.apache.org/configuration.html

我需要在运行时监听属性变化。那么,如果我像这样注入一个属性,然后在运行时更改属性文件中的轮询间隔值,这个更改会被拾取吗?

@Inject
@ConfigProperty(name = "endpoint.poll.interval")
private Integer pollInterval;
4

1 回答 1

2

It will depend on the scope of your config source. If your config source is RequestScoped, it's going to get refreshed with each request.

于 2013-10-15T11:26:18.330 回答