I'm using priority job queue in an project which uses the concepts of clean architecture. The thing is: to do DI with priority job queue I need to create a BaseJob job like this:
abstract public class BaseJob extends Job {
@Retention(RetentionPolicy.SOURCE)
@IntDef({UI_HIGH, BACKGROUND})
public @interface Priority {
}
public static final int UI_HIGH = 10;
public static final int BACKGROUND = 1;
public BaseJob(Params params) {
super(params);
}
protected boolean shouldRetry(Throwable throwable) {
return true;
}
public void inject(ApplicationComponent appComponent) {
}
The problem is that in the lines:
public void inject(ApplicationComponent appComponent) {
}
I need to access ApplicationComponent which is in presentation's layer, but since my BaseJob is in data's layer I don't have access to it.
If I make data's layer know about presentation I will break the principles of clean architecture.
Does anyone have an idea how I could do that?