Results 1 to 4 of 4

Thread: allow dynamic access to getters and setters..

  1. #1
    Join Date
    Jul 2006
    Posts
    154

    Default allow dynamic access to getters and setters..

    hi..

    i have a bean which not always need to allow accesss to it's getters and setters, (based on infomation from a hasmap which says which properties should be accessed.

    i was thinking, that an advice before the setter is activated could throw an exception.

    is this correct? or is there a better way?

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    AOP sounds like the way to go - however, note that the advice will kick in after the applicationContext has been configured (during the configuration if you are using the setter for configuration it will be used as such - just making it clearer).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Jul 2006
    Posts
    154

    Default

    the applicationContext is configured only once as i understand from the webcontainer, the behviour i'm talking about should occur in run-time during the life of the application is that ok?

  4. #4
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Yes - that's fine; this is how things are supposed to work.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

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