io.scalecube.services.Injector Maven / Gradle / Ivy
package io.scalecube.services;
import io.scalecube.services.annotations.AfterConstruct;
import io.scalecube.services.annotations.BeforeDestroy;
import io.scalecube.services.annotations.Inject;
import io.scalecube.services.routing.Router;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
import reactor.core.Exceptions;
/** Service Injector scan and injects beans to a given Microservices instance. */
final class Injector {
private Injector() {
// Do not instantiate
}
/**
* Inject instances to the microservices instance. either Microservices or ServiceProxy. Scan all
* local service instances and inject a service proxy.
*
* @param microservices microservices instance
* @param services services set
* @return microservices instance
*/
public static Microservices inject(Microservices microservices, Collection