Can you also post a snippet where you inject the queue. Maybe the reason lies 
there.

Am 25. Dezember 2015 19:51:33 MEZ, schrieb Sneh Tekriwal 
<snehtekri...@gmail.com>:
> 
><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();
>
>
>But obviously it is not returning me a singleton due to some odd reason
>(My 
>Guess is because I am binding it to new TypeLiteral). Any idea on how
>to 
>fix it or is there any better way to do it?
>
>-- 
>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 google-guice+unsubscr...@googlegroups.com.
>To post to this group, send email to google-guice@googlegroups.com.
>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/86f266dc-16a9-4301-bc20-2d5138d04c63%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
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 google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
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/B7327F5D-7529-4EAF-B85A-556C96BF2EC1%40gmx.ch.
For more options, visit https://groups.google.com/d/optout.

Reply via email to