I tried to enter a contract into a contract:
@org.jvnet.hk2.annotations.Contract
public interface CategoryDAO{
}
@org.jvnet.hk2.annotations.Service
public class HibernateCategoryDAO implements CategoryDAO
}
@org.jvnet.hk2.annotations.Service
public class MyCategoryManager implements CategoryManager {
@javax.inject.Inject
CategoryDAO categoryDAO;
}
But categoryDAO is null.
I even tried tying it up:
public class ServiceBinder implements Binder {
@Override
public void bind(DynamicConfiguration config) {
config.bind(BuilderHelper.link(HibernateCategoryDAO.class).to(CategoryDAO.class).build());
}
}
But still, it remains zero.
I initialize MyCategoryManagerwith the Reflections structure as follows:
Set<?> managers = Reflections.getSubTypesOf(CategoryManager.class);
source
share