-
Aug 7th, 2009, 02:45 AM
#1
Initialization callbacks on non singleton objects
i'm trying to use a initialization callback in a prototype scoped object.
Unfortunately when i'm doing this, Spring AS initializes the object at container startup and calls the init method.
When the object get's Autowired, a new instance is created, but the init method isn't called.
Do you know how to get Spring AS to call my init method each time it creates a new instance?
My object configuration:
<object id="browserDialogPM"
class="de. ... .BrowserDialogPM" scope="prototype">
<property name="historyService" ref="historyGadgetPM"/>
<method-invocation name="init"/>
</object>
-
Aug 7th, 2009, 02:54 AM
#2
ok, ok, found a solution by myself - this works a intended:
<object id="browserDialogPM"
class="de. ... .BrowserDialogPM" scope="prototype" init-method="init">
<property name="historyService" ref="historyGadgetPM"/>
</object>
Seams as if the documentation is not correct st this point, the both ways are described as "...is exactly the same as..."
-
Aug 20th, 2009, 04:04 PM
#3
its a bug
Hey Andreas,
what you're dealing here with is, in fact, a bug:
http://jira.springframework.org/brow...IONSCRIPTAS-43
If things are going according to plan this will be fixed in the upcoming v0.8.1 release.
cheers,
Roland
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules