Results 1 to 3 of 3

Thread: Initialization callbacks on non singleton objects

  1. #1

    Default 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>

  2. #2

    Default

    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..."

  3. #3
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    407

    Default 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
  •