zhongxan / emite

Automatically exported from code.google.com/p/emite
0 stars 0 forks source link

RoomChatManager get initializes twice even though the module says "Singleton" #340

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Injecting to a class constructor
2. Injecting to a method
3.

What is the expected output? What do you see instead?
Expected as a Singleton RoomChatManager. RoomChatManager get initiated twice 
which results to two times handling of invitation

What version of the product are you using? On what operating system?
emite0.6. Fedora13

Please provide any additional information below.

Original issue reported on code.google.com by jiunara...@gmail.com on 17 Jan 2011 at 10:40

GoogleCodeExporter commented 8 years ago
How I tackle the problem is providing annotation @Singleton in RoomChatManager 
class, eventhough it is specified as Singleton in MucModule. May be this is for 
the time being solution. 
Any reply will be helpful.

Original comment by jiunara...@gmail.com on 17 Jan 2011 at 11:01

GoogleCodeExporter commented 8 years ago
Are you using the same injector? If so, we should add the @Singleton annotation 
to the class itself.

Original comment by danigb on 17 Jan 2011 at 11:04

GoogleCodeExporter commented 8 years ago
But when the module says "in(Singleton.class)", if I am not wrong it means that 
the injector would give singleton, which didn't.
And danigb is trying to say that singleton happens only for different injector. 
Correct me if I am wrong?

Original comment by jiunara...@gmail.com on 20 Jan 2011 at 10:51

GoogleCodeExporter commented 8 years ago
Could this be something to do with the Suco compatibility layer?

I have a feeling (although may be wrong) that this could cause duplicate 
singleton objects as it instantiates its own ginjector. Make sure that you're 
not including the EmiteSuco GWT module (unless you're using it, of course!).

Original comment by ashward....@gmail.com on 24 Feb 2011 at 3:15