How to use dependency injected variable in the same class as the bind?

37 views Asked by At

Is it possible to use injection in the same class as where the implementation is bound? For example I have

this.bind(ServiceAImpl.class).to(ServiceA.class).in(Singleton.class)

and in the same class I need

final var server = ServerBuilder.forPort(1234).addService(new GrpcServerRequestHandler()).build();
//Here I want to use new GrpcServerRequestHandler(injected singleton ServiceAImpl.class object)

How to achieve this?

0

There are 0 answers