public static Microservices inject ( Microservices microservices , Collection < Object > services ) { services . forEach ( service -> Arrays . stream ( service . getClass ( ) . getDeclaredFields ( ) ) . forEach ( field -> injectField ( microservices , field , service ) ) ) ; services . forEach ( service -> processAfterConstruct ( microservices , service ) ) ; return microservices ; }
Inject instances to the microservices instance . either Microservices or ServiceProxy . Scan all local service instances and inject a service proxy .