在 WebSphere Liberty Profile 中,我能否以编程方式访问 server.xml 中定义的变量?

In WebSphere Liberty Profile, can I access variables defined in server.xml programmatically?

我想以编程方式访问“wlp.password.encryption.key”变量。可能吗?

这是可能的,但只能通过 SPI(意味着仅在用户或产品扩展中,而不是在应用程序中)。

http://www.ibm.com/support/knowledgecenter/SSHR6W_9.0.0/com.ibm.websphere.javadoc.liberty.doc/com.ibm.websphere.appserver.spi.kernel.service_1.5-javadoc/com/ibm/wsspi/kernel/service/location/VariableRegistry.html

VariableRegistry 将是一个可发现的 OSGi 服务(选择你喜欢的发现机制,我推荐 DS)。