title: Dynamic proxy for concrete classes
body: <p>I want to define a method interceptor in a Java program in other words I want to have a behaviour which is executed at each method call.
  This application isn't executed in an application server and therefore I can't use the EJB around invoke interceptors.
  I have found a nice <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/reflect/Proxy.html" rel="noreferrer">Proxy</a> API in the standard Java libraries but its limited because it needs an interface in the proxy creation:</p>
  
  <pre><code> Foo f = (Foo) Proxy.newProxyInstance(Foo.class.getClassLoader(),
                                        new Class[] { Foo.class },
                                        handler);
  </code></pre>
  
  <p>Is there a similar API which doesn't force Foo.class to be declared as an interface? </p>