Results 1 to 3 of 3

Thread: Parent bean, factory and constructor-args

  1. #1

    Default Parent bean, factory and constructor-args

    We have a factory bean we are writing. Currently, it takes 3 arguments in it's constructor, 2 of which are always the same, and 1 which will always vary.

    I'd like to use an 'abstract bean definition', but it doesn't seem possible since this is not a property-based factory. Is there a way to do it? When I tried, splitting the arguments between two bean definitions, it said it could match the constructor. I even used 'index'.

    Thanks.
    David

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    I would suggest putting the variable property to not be in the constructor but set as a property. Then use an init-method do any special post constructor processing. If your factory bean uses Spring interfaces you can implement InitializingBean and instead of an init-method use afterPropertiesSet.
    Bill

  3. #3
    Join Date
    Dec 2005
    Posts
    269

    Default

    you won't even need an init() method, as you can validate all your params (2 for constrcuor, 1 for property) within setProperty() method.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •