<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Java Multi-Methods Using Proxies and Annotations</title>
	<atom:link href="http://www.concurrentaffair.org/2008/10/03/java-multi-methods-using-proxies-and-annotations/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.concurrentaffair.org/2008/10/03/java-multi-methods-using-proxies-and-annotations/</link>
	<description>a blog about Mathias&#039; work and play.</description>
	<lastBuildDate>Wed, 23 Nov 2011 00:35:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Mathias</title>
		<link>http://www.concurrentaffair.org/2008/10/03/java-multi-methods-using-proxies-and-annotations/comment-page-1/#comment-9</link>
		<dc:creator>Mathias</dc:creator>
		<pubDate>Mon, 06 Oct 2008 21:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=616#comment-9</guid>
		<description>&lt;p&gt;Ted, thank you for this wonderful comment. I&#039;ll look at the Enhancer class. It seems like it solves this issue perfectly.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ted, thank you for this wonderful comment. I&#8217;ll look at the Enhancer class. It seems like it solves this issue perfectly.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: emorning</title>
		<link>http://www.concurrentaffair.org/2008/10/03/java-multi-methods-using-proxies-and-annotations/comment-page-1/#comment-8</link>
		<dc:creator>emorning</dc:creator>
		<pubDate>Mon, 06 Oct 2008 21:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.concurrentaffair.org/?p=616#comment-8</guid>
		<description>&lt;p&gt;Hi Mathias,&lt;/p&gt;

&lt;p&gt;I have also implemented muilimethods in a java framework that I am working on.
I too wanted to be able to use abstract methods instead of interfaces so that I could put default implementation of methods in the interfcae definitions.&lt;/p&gt;

&lt;p&gt;Anyway, I am currently using the cglib library instead of Java proxies.
It was very easy to replace java.lang.reflect.Proxy class with the net.sf.cglib.proxy.Enhancer class.
Basically the Enhance lets you create a proxy using abstract classes instead of interfaces.&lt;/p&gt;

&lt;p&gt;Here&#039;s an example of how to use it...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Enhancer enhancer = new Enhancer();
    enhancer.setSuperclass(roleClass);
    enhancer.setInterfaces(new Class[] { MeteorProxy.class });
    enhancer.setCallback(new RoleInvocationHandler(_repository, this, roleClass));
    enhancer.setClassLoader(Activator.getMeteorClassloader());
    role= (T)enhancer.create();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;...the classes passed to the setInterfaces method may include abstract classes as well as interfaces.&lt;/p&gt;

&lt;p&gt;Best Regards,
ted stockwell&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Mathias,</p>

<p>I have also implemented muilimethods in a java framework that I am working on.
I too wanted to be able to use abstract methods instead of interfaces so that I could put default implementation of methods in the interfcae definitions.</p>

<p>Anyway, I am currently using the cglib library instead of Java proxies.
It was very easy to replace java.lang.reflect.Proxy class with the net.sf.cglib.proxy.Enhancer class.
Basically the Enhance lets you create a proxy using abstract classes instead of interfaces.</p>

<p>Here&#8217;s an example of how to use it&#8230;</p>

<pre>

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Enhancer enhancer = new Enhancer();<br />
&nbsp; &nbsp; enhancer.setSuperclass(roleClass);<br />
&nbsp; &nbsp; enhancer.setInterfaces(new Class[] { MeteorProxy.class });<br />
&nbsp; &nbsp; enhancer.setCallback(new RoleInvocationHandler(_repository, this, roleClass));<br />
&nbsp; &nbsp; enhancer.setClassLoader(Activator.getMeteorClassloader());<br />
&nbsp; &nbsp; role= (T)enhancer.create();</div></td></tr></tbody></table></div>

</pre>

<p>&#8230;the classes passed to the setInterfaces method may include abstract classes as well as interfaces.</p>

<p>Best Regards,
ted stockwell</p>]]></content:encoded>
	</item>
</channel>
</rss>

