Announcement Announcement Module
No announcement yet.
Initialization callbacks on non singleton objects Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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"/>

  • #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"/>

    Seams as if the documentation is not correct st this point, the both ways are described as " exactly the same as..."


    • #3
      its a bug

      Hey Andreas,

      what you're dealing here with is, in fact, a bug:

      If things are going according to plan this will be fixed in the upcoming v0.8.1 release.