This is regarding to the Play framework 2.5.x
I have few Guice modules which extended by the AbstractModule
and they are added as bindings to the GuiceApplicationBuilder
method like below.
@Override
public GuiceApplicationBuilder builder(ApplicationLoader.Context context) {
return initialBuilder
.in(context.environment())
.bindings(new LoggerModule())
.bindings(new BaseConnectionModule(configuration))
.bindings(new CacheModule(configuration))
.bindings(new DaoModule())
....
One of my module (say CacheModule
) declared private variables in that which are also Guice injected to be used in that class(inside Guice @Provides
methods). The bindings for those variable are done in one of a GuiceModule (say BaseConnectionModule
) which bound prior to the current module as mentioned in above code.
My question is, when the application get started, such variables declared as private in the CacheModule
are not get instantiated.
Can someone please answer to this?