Lets say I populate the ServiceRegistry with some class and have a MVC controller like so:
@Path("/my-controller")
@Module
class MyController @Inject constructor(private val myService: MySerivce) {
@GET
fun helloWorld(ctx: Context): String {
val serviceFromRegistry = ctx.require(ServiceFromRegistry::class.java, "serviceFromRegistry")
...
}
}
Do I always need to use the contxt to get my service from the registry (ServiceFromRegistry)? Or is it possible to use guice as with the other service (MyService)?