Class ClasspathDependencyInjectorService

java.lang.Object
net.thucydides.model.steps.di.ClasspathDependencyInjectorService
All Implemented Interfaces:
DependencyInjectorService

public class ClasspathDependencyInjectorService extends Object implements DependencyInjectorService
This class is responsible for loading and returning instances of DependencyInjector discovered in the classpath. Thread safety is achieved as the findDependencyInjectors() method operates only on local variables, therefore eliminating risks of shared mutable state. However, the thread safety of the returned DependencyInjector instances will depend on their individual implementations. It uses ServiceLoader under the hood to load the implementations of DependencyInjector.

Usage:

   ClasspathDependencyInjectorService service = new ClasspathDependencyInjectorService();
   List injectors = service.findDependencyInjectors();