Return-Path: Delivered-To: apmail-incubator-geronimo-dev-archive@incubator.apache.org Received: (qmail 84332 invoked by uid 500); 25 Aug 2003 13:34:00 -0000 Mailing-List: contact geronimo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: geronimo-dev@incubator.apache.org Delivered-To: mailing list geronimo-dev@incubator.apache.org Received: (qmail 84280 invoked from network); 25 Aug 2003 13:33:59 -0000 Received: from onramp.i95.net (205.177.132.17) by daedalus.apache.org with SMTP; 25 Aug 2003 13:33:59 -0000 Received: from apache.org ([66.208.12.130]) by onramp.i95.net (8.12.9/8.12.9) with ESMTP id h7PChoKx013243 for ; Mon, 25 Aug 2003 08:43:50 -0400 Message-ID: <3F4A0487.60904@apache.org> Date: Mon, 25 Aug 2003 08:43:51 -0400 From: Berin Loritsch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: geronimo-dev@incubator.apache.org Subject: Re: [bcel] Is anyone a BCEL expert? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Dain Sundstrom wrote: > We are going to need some BCEL code which varies from simple to quite > complex. If you are an expert or eager to learn, here is what we need > (from simple to complex): > > > > Interface proxy generator -- This is a copy of java.reflection.Proxy. > Why do we need a copy? Well I think it is a good starting point for the > rest of the stuff, and I know we can do it better. I would like the > proxy generator to be able to generate class names that have some > meaning other then Proxy$24, and I think we can write code that this > faster. I'm not an expert, but the Avalon Fortress Codebase has something to start with for proxying components based on interfaces. Essentially it works by only exposing the interfaces you want exposed (like the client interfaces), and forwards the call on to the original object. Due to the fact that it is BCEL generated and it essentially creates the equivalent of this: public void foo() { proxied.foo(); } It is much faster than the java.lang.Proxy which is based completely on reflection (you are always invoking a method via the java.lang.reflect.Method object). However, there is a performance hit, which should be acceptable in all but the most grueling environments. There are some minor issues with it though. For instance when you invoke a method through BCEL, it has to be called on the class that implements the method. For instance if you have AbstractFoo and FooImpl, with the method foo() (from above) implemented in AbstractFoo, then BCEL has to call AbstractFoo.foo()--it is not smart enough to follow the inheritance heirarchy to find the class for you. Anyhoo, it is a starting place. > > > This should be a very fun project. I'd do it myself, but I've got too > many other things on my plate right now. > Working with BCEL is an excercise in masochism--but it is very powerful once you have it working for you. -- "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin