Unless a singleton object in graph is annotated with a Qualifier we can just call:
graph.get(Bus.class);
If this object is annotated in the module definition with a Qualifier then it will throw IllegalStateException.
Is there a better way of retrieving that object from the graph than:
public class BusWrapper {
@Inject
@MyQualifier
Bus bus;
}
and
graph.inject(new BusWrapper()).bus;
I have a set of graphs (one graph for each account). Separate bus for each account graph and one app scoped bus (annotated with different Qualifier). Once I receive a GCM sync request message I need to retrieve the bus from the correct graph to pass the sync request.