Your code does not compile because you are not initializing the Server server variable, which is final . In any case, you can pass the Provider , which should provide the App your A , when it becomes available (fully initialized). Your code might look like this:
public App(){ appProvider = new Provider<App>() { private volatile App app;
then you can check A whether the provider returns get null or not. I believe the javax.inject package contains the appropriate Provider interface for you.
The registerStuff method is great for providing the App , because at this point it is fully initialized. This also answers your question about lazy initialization.
source share