|
From: <jue...@we...> - 2004-05-28 12:58:14
|
Mike,
=20
Your approach seems to be perfectly OK. I've just tried to reproduce =
your issue but wasn't able to: I always get a single instance, no matter =
if implementing ApplicationListener or not. Could you double-check the =
effect, and possibly send a minimal test case that reproduces the =
problem?
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Mike Cannon-Brookes
Gesendet: Fr 28.05.2004 08:39
An: Spring Developer
Betreff: [Springframework-developer] Strange 'double' singleton bug
I'm not sure if this is a bug or not, it's certainly strange behaviour.
We had a singleton bean that was operating normally, but when we make
it implement ApplicationListener - we get _two_ instances of it
created. (Tested by simply putting a debug point in the constructor -
two separate beans are created)
Here's the config snippet:
<bean id=3D"macroManager"
class=3D"com.atlassian.renderer.macro.DefaultMacroManager">
<constructor-arg>
<ref local=3D"macroStateStore"/>
</constructor-arg>
<constructor-arg>
<list>
<ref local=3D"beanMacroLoader"/>
<ref local=3D"classpathMacroLoader"/>
</list>
</constructor-arg>
</bean>
Is this a known bug, a feature or am I not meant to use
ApplicationListener this way? (if it's a bug it's quite serious I'd
say)
I want to do it this way because another part of Confluence fires an
event to say that all setup has finished - and I want this bean to
listen for that event and further initialize itself.
I just guessed that in Spring I would just need to implement the
ApplicationListener interface and listen for events - if I need to do
anything else, let me know :)
Cheers,
Mike
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|