From: Bill H. <bi...@lo...> - 2003-09-09 14:48:08
|
Hi Christian, On Tue, 2003-09-09 at 10:58, Christian Nedregaard wrote: > The same strategy will be applied to the ShutdownHook except that we > will not offer any alternative implementation for 1.2. We'll simply > document that 1.2 users will have to take care of the shutdown > expilcitly. That's done and committed to CVS. > CGLIB (http://cglib.sourceforge.net/) [snip] > CGLIB added a slight overhead compared to JDK Proxy calls, but it was very tiny. Yep, I don't think that overhead is significant. > I guess the best solution would be to use a similar approach to that > mentioned above: Use Proxy for 1.3+ and CGLIB for 1.2. The problem > here is that I have not figured out how to make a class implement the > InnvocationHandler *runtime* with CGLIB. This is a simple method call > in Javassist. I'll investigate further... > Another compelling approach is to simply stop using the JDK Proxy and > use the CGLIB Proxy all over. If we go that route we can throw away > the 1.2 source tree today... That sounds fine. Just to throw another idea into the confusion: Jakarta Commons' Logging uses a compromise solution. Their source only compiles with JDK1.4 (because of the reference to JDK1.4's logging), but it works well under JDK1.2+ because it just ignores that class if it isn't available. We *could* do the same - it would mean you couldn't build from source with JDK1.2 but it would be fully supported. *Another* solution, which you have already described Christian, is to write a small adapter that links the ProxyFactory to whatever proxy implementation we use and you write this as plain text which is compiled at runtime by something like ASM. Advantage: source compiles under any JDK; disadvantage: adds a layer of complexity to our source code that has to be maintained. I just mention those other two options in passing. I think I actually favour what you just suggested. Use CGLIB for all JDKs right now. If getting it to switch between CGLIB and the JDK proxy is going to be at all difficult then postpone it to a future release. 73, Bill |