Results 1 to 3 of 3

Thread: Best way to build custom proxies?

  1. #1
    Join Date
    Aug 2004
    Location
    Irvine, CA
    Posts
    17

    Default Best way to build custom proxies?

    I thought I'd troll for some insight on the best way to build a custom proxy?

    The requirement: I have about 20 beans of various classes. I have another bean where I want to consume these 20 beans with some added functionality. Basically I want to declare 20 entries that wrap the 20 target beans and add 2 more methods, where the behavior of these 2 new methods is controlled by metadata introduced in the XML file.

    My current method of resolution: Create a new class that will subclass ProxyConfig and implement FactoryBean - and has its own getters and setters for the metadata properies, and implements the methods I need that are driven off that metadata.

    Was there a better way to do this?

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

    Default

    I'm not sure if I completely understand what you want to do, but it seems that you should use an IntroductionAdvisor adding the new interface and add it using one of the auto proxy creators like BeanNameAutoProxyCreator.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3
    Join Date
    Aug 2004
    Location
    Irvine, CA
    Posts
    17

    Default

    Thanks Rod -- the IntroductionAdvisor was what I was looking for.

    I basically had a concrete bean instance but I wanted to wrap it with proxies when I was setting it into another bean so I could introduce an interface at runtime to the bean.

    I had subclassed ProxyConfig and implemented FactoryBean to do this in a similar manner to how transactions were handled.

Similar Threads

  1. Replies: 2
    Last Post: Sep 1st, 2009, 09:24 AM
  2. Using Custom Tags with Spring
    By CaptainMu in forum Web
    Replies: 7
    Last Post: Jul 7th, 2008, 07:00 AM
  3. Replies: 2
    Last Post: Aug 2nd, 2006, 10:18 PM
  4. Replies: 3
    Last Post: Nov 15th, 2005, 03:24 PM
  5. Petclinic Build Error (Plus Suggested Fix)
    By steve_smith in forum Swing
    Replies: 4
    Last Post: Nov 15th, 2004, 04:32 PM

Posting Permissions

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