8 Replies Latest reply: Jan 12, 2010 9:37 AM by 843798 RSS

    Dynamic proxy, several instances, same name, diff ids?

    843798
      I'm using a dynamic proxy with a simple invocation handler. Using the proxy for several instances of the target object should yield multiple instances of the proxy. In the debugger, each proxy instance is named $proxy0 with different ids. Can someone please elaborate on this? Specifically, the Proxy instance is created using the target object. Thus, how can each proxy instance have the same name, when different target objects (of the same type though) are used to construct the Proxy object? Is the Proxy instance the same regardless of the target object?

      I : interface
      T: target class

      pseudo thing:
      <code>

      T t1, t2, t3 ... new ...

      I i1 = (I) Proxy.newInst...(..., ..., t1)

      I i2 = (I) Proxy.newInst...(..., ..., t2)


      I i3 = (I) Proxy.newInst...(..., ..., t3)

      Each i has name $proxy0 with different id. For instance: i1-> $proxy0 id=68, i2 ->$proxy0 id= 32, etc.
      </code>

      Insight is appreciated!