Results 1 to 2 of 2

Thread: "target property" or "last entry in intercept

  1. #1
    Join Date
    Aug 2004
    Location
    Singapore
    Posts
    3

    Default "target property" or "last entry in intercept

    Hi,

    I put the bean to be proxied in the property@name="target", and set a property@name="singleton" to true for ProxyFactoryBean. This gives me an exception saying that name is null when refreshing target. I found that the exception is thrown in the method refreshTarget().

    after reading the src, I found that when using "prototype" (singleton=false), ProxyFactoryBean expects the targetsource to be appended as the last entry in interceptorNames, and not in the "target" property. Is this the desired behaviour? using the "target" property alone works fine if I set singleton to true.

    Thanks..

    Zehua Liu

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    Yes, this is normal behaviour. In the case of a prototype, the config needs to specify the bean name of the target, rather than have a reference, as the target instance will vary each time, and results from a BeanFactory lookup performed when a proxy is created by ProxyFactoryBean.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

Posting Permissions

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