Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.java.programmer > #5248

Re: Create Dynamic Proxy for class instead of interface

From Stanimir Stamenkov <s7an10@netscape.net>
Newsgroups comp.lang.java.programmer
Subject Re: Create Dynamic Proxy for class instead of interface
Date 2011-06-12 20:42 +0300
Organization A noiseless patient Spider
Message-ID <it2tq5$tb3$1@dont-email.me> (permalink)
References <it2hld$h99$1@dont-email.me> <it2j4j$q7m$1@dont-email.me> <95ka2uFjg5U1@mid.individual.net>

Show all headers | View raw


Sun, 12 Jun 2011 19:07:41 +0200, /Robert Klemme/:

> If you read closely what the Javadoc of ProxyFactory say, you will
> notice that you get a _new_ class which is a _subclass_ of the class
> that you want to augment. For that you do not need proxy mechanisms.
> In fact it is much simpler to inherit the class and make the new
> class implement additional interfaces.
> [...]
> Why do you need to manipulate an existing class?

Though I don't know how useful it might be, I've played a bit at 
implementing the try-with-resources [1] (the easier part) and 
exception masking Java 7 features using Java 6 facilities.  For the 
later I needed to create proxy exceptions augmented with interface 
allowing to attach 'suppressed' exceptions information.

[1] 
http://www.oracle.com/technetwork/articles/java/trywithresources-401775.html

-- 
Stanimir

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Create Dynamic Proxy for class instead of interface Stanimir Stamenkov <s7an10@netscape.net> - 2011-06-12 17:15 +0300
  Re: Create Dynamic Proxy for class instead of interface Stanimir Stamenkov <s7an10@netscape.net> - 2011-06-12 17:40 +0300
    Re: Create Dynamic Proxy for class instead of interface Robert Klemme <shortcutter@googlemail.com> - 2011-06-12 19:07 +0200
      Re: Create Dynamic Proxy for class instead of interface Stanimir Stamenkov <s7an10@netscape.net> - 2011-06-12 20:42 +0300
  Re: Create Dynamic Proxy for class instead of interface Tom Anderson <twic@urchin.earth.li> - 2011-06-13 11:58 +0100

csiph-web