mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
refactor(framework): support inject Standalone into Standalone modules
This commit is contained in:
@@ -13,7 +13,7 @@ import java.lang.reflect.Modifier
|
|||||||
*
|
*
|
||||||
* 注入关系:
|
* 注入关系:
|
||||||
* - `sub + standalone -> running`
|
* - `sub + standalone -> running`
|
||||||
* - `sub -> standalone`
|
* - `sub + standalone -> standalone`
|
||||||
* - `sub + standalone -> additionalComponent`
|
* - `sub + standalone -> additionalComponent`
|
||||||
*
|
*
|
||||||
* 当注入目标无匹配实例或存在多个匹配实例时抛出异常。
|
* 当注入目标无匹配实例或存在多个匹配实例时抛出异常。
|
||||||
@@ -45,7 +45,8 @@ class ComponentInjectorFactory : AgentBaseFactory() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
standaloneModules.forEach { standalone ->
|
standaloneModules.forEach { standalone ->
|
||||||
injectIntoTarget(standalone.instance, subInstances)
|
val providersForStandalone = subInstances + standaloneInstances.filter { it !== standalone.instance }
|
||||||
|
injectIntoTarget(standalone.instance, providersForStandalone)
|
||||||
subModules.forEach { it.injectTarget.add(standalone.instance) }
|
subModules.forEach { it.injectTarget.add(standalone.instance) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user