Assume you have such class:
@SomeScope
class ServiceScopeManager {
@Inject
Dependency1 dependency1;
@Inject
Dependency2 dependency2;
@Inject
ServiceScopeManager(){
}
@Inject
void init(){
//do something really important with dependencies
}
}
- This class isn't injected to any other class
- This class isn't provided to any
@Provides
method in module
As you can see it's high level class and it, for example, may listens for some events in system and performs releasing of his dependencies.
The problem is that this class won't be ever created, because nothing depends on it.
Can i somehow tell dagger to create dependency always on component creation (for example) not when needed as by default? Or maybe with any other way to achive requirements.