mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
refactor(framework): support inject Standalone module into Sub module
This commit is contained in:
@@ -13,6 +13,7 @@ import java.lang.reflect.Modifier
|
||||
*
|
||||
* 注入关系:
|
||||
* - `sub + standalone -> running`
|
||||
* - `standalone -> sub`
|
||||
* - `sub + standalone -> standalone`
|
||||
* - `sub + standalone -> additionalComponent`
|
||||
*
|
||||
@@ -44,6 +45,11 @@ class ComponentInjectorFactory : AgentBaseFactory() {
|
||||
standaloneModules.forEach { it.injectTarget.add(running.instance) }
|
||||
}
|
||||
|
||||
subModules.forEach { sub ->
|
||||
injectIntoTarget(sub.instance, standaloneInstances)
|
||||
standaloneModules.forEach { it.injectTarget.add(sub.instance) }
|
||||
}
|
||||
|
||||
standaloneModules.forEach { standalone ->
|
||||
val providersForStandalone = subInstances + standaloneInstances.filter { it !== standalone.instance }
|
||||
injectIntoTarget(standalone.instance, providersForStandalone)
|
||||
|
||||
Reference in New Issue
Block a user