你可以从java注释访问环境属性吗?

时间:2012-04-27 06:54:25

标签: java properties annotations environment

我有一个看起来像这样的注释:

@MessageDriven
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1")
public class ProcessingEntitiesQueueListenerMDB implements MessageListener { 
     ......
     ......
     .....
}

是否可以从环境变量传入maxSession的值? 类似的东西:

@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "${mdb.maxSessionVal")

参数mdb.maxSessionVal将使用-Dmdb.maxSessionVal = 10或类似的东西传递。

是否可以或在编译时修复它们?

0 个答案:

没有答案