On 12/25/2015 07:51 PM, Sneh Tekriwal wrote: > > <http://stackoverflow.com/questions/34464489/return-singleton-queuet-in-guice#> > > > I am using Google Guice for dependency injection and I require a singleton > Queue<T>. > > Here is the code to return the queue. > > > bind( > new TypeLiteral<Queue<Entity>>() { } > ).annotatedWith(OurBulletQueue.class).to( > new TypeLiteral<ArrayDeque<Entity>>() { } > ).asEagerSingleton();
Does bind(...).annotatedWith(..).to(new ArrayDequeue<Entity>()).in(Scopes.SINGLETON); work? -dirk -- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-guice. To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/5682C923.7060301%40googlemail.com. For more options, visit https://groups.google.com/d/optout.
