Announcement Announcement Module
Collapse
No announcement yet.
Initialization callbacks on non singleton objects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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"/>
    </object>

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

    Comment


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

      Comment

      Working...
      X