i have got module and this module only read config from server via async callbacK:
@Singleton
public class Config {
private ConnectionSettings connectionSettings;
@Inject
protected Config(final MainRPCAsync mainRpc) {
configureConnection(mainRpc);
}
private void configureConnection(MainRPCAsync mainRpc) {
Log.debug("****Configure connection..");
mainRpc.getConfig(new AsyncCallback<Configuration>() {
@Override
public void onSuccess(Configuration result) {
Log.debug("-----------Get config");
//initialize configuration settings
});
}
});
and next this class Config
is injected to another module but when i need to get configSettings
from that module i get only null
....
and in log console i read info that line Log.debug("-----------Get config");
show info after all ...
Its possible be sure that connection settings will be initialized by rpc async before injection that class to another module ?