Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Sebastian Newsgroups: comp.lang.java.programmer Subject: Re: Dynamic method invocation on Proxy object? Date: Wed, 08 Feb 2012 15:16:45 +0100 Organization: albasani.net Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net ovcPYFGWOU7Lej46LYgwfted7BdSrmT+76qUJd06WIZ5J4rplesZm5TwsAMgm2eNVh37O7ucfuL3lSnzluqJEQ== NNTP-Posting-Date: Wed, 8 Feb 2012 14:16:45 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="uvZN+cAbTKVkx2ubpNNaRUVf+dsZk6YjMXpafv1G1qiLgDQh7ms31qRJlK4JlK6iV6fsvsLqa31lmSBP/UqQWG8Dzegk56WQsDxdpBqixqHfgXrceHJtW3vSdwflROYP"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: Cancel-Lock: sha1:95xf3znW/lDOd7aFfVH0fJjQSAA= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11852 Am 08.02.2012 11:34, schrieb Steven Simpson: > On 08/02/12 08:19, Sebastian wrote: >> However, when delegate is itself a proxy, then delegate.getClass() >> will give me Proxy, > > Are you sure? I get $Proxy0 from this: > [coding snipped] > > Output: > > Proxy class is: class $Proxy0 > Called public abstract void java.lang.Runnable.run() > Called public abstract void java.lang.Runnable.run() > > It also demonstrates a method on the implemented interface being looked > up and invoked. Thanks for that. I found my mistake - the reason that I could not find the target method turned out to be different classloaders for the argument types, so the signatures did not match. -- Sebastian