我想在项目A
中使用项目B
,我想使用XML配置文件将一些配置参数传递到项目A
。< / p>
换句话说,假设我正在实现类似我自己的spring-data-mongo
(例如),我想从我已定义的配置文件中配置我的Mongo实例,如下所示:
<mongo: mongo host = "$ {mongo.hostname}" port = "$ {mongo.port}">
<mongo: options connections-per-host = "8"
threads-allowed-to-block-for-connection-multiplier = "4"
connect-timeout = "15000"
max-wait-time = "1500"
auto-connect-retry = "true"
socket-keep-alive = "true"
socket-timeout = "60000"
slave-ok = "true"
write-number = "1"
write-timeout = "0"
write-fsync = "false" />
我如何实现这样的目标?