We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a class i wan't inject For legacy code support it is like this.
@Singleton public class Applications extends AbstractModule { private Applications() {} private static class ApplicationsLoader { static final Applications INSTANCE = new Applications(); } @Override protected void configure() {} @Provides @Singleton public Applications get() { return ApplicationsLoader.INSTANCE; } public static Applications getApps() { return ApplicationsLoader.INSTANCE; } }
On application startup , I create injector.
public void startup() throws Exception { initLogging(); Injector injector = Guice.createInjector(Stage.PRODUCTION, Applications.getApps()); }
but some while after, when I need Applications.class i always get a null
public class Blob { @Inject private Applications applications; ..... }
Any suggestions how to share Applications.class singleton? injector.getInstance(Applications.class) working fine.
Regards
The text was updated successfully, but these errors were encountered:
Do you create a Blob class in appropriate way?
Blob
injector.getInstance(Blob.class)
Sorry, something went wrong.
No branches or pull requests
I have a class i wan't inject
For legacy code support it is like this.
On application startup , I create injector.
but some while after, when I need Applications.class i always get a null
Any suggestions how to share Applications.class singleton?
injector.getInstance(Applications.class) working fine.
Regards
The text was updated successfully, but these errors were encountered: