SubCut BindingModule composition

社会主义新天地 提交于 2019-12-08 06:41:02

问题


With SubCut I can define a BindingModule and use modifyBindings to get a new one which can overwrite some bindings and also add new bindings. Is there a utility where instead of saying

val module : BindingModule
val newModule = module.modifBindings(...)

I could instead do something like

val mergedModule = merge(module1,module2,module3,...)

The reason is I am writing an application with "pluggable" jars - each such jar will have a META-INF/bindings.properties file which will expose the class name of its BindingModule. My main entry jar will instantiate those BindingModules via reflection and then combine them.

The idea being that if the pluggable jars follow the convention of providing META-INF/bindings.properties then there is no new configuration needed to deploy the application.


回答1:


Yes, just use the ~ operator, as shown in this test case from the SubCut project.

For the case of interdependent modules, please expand your question with more details on how you implemented that.



来源:https://stackoverflow.com/questions/9303262/subcut-bindingmodule-composition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!