Hi, Could someone look at this and apply the changes?
---------- Forwarded Message ---------- Subject: AW: [Newbie] Proxy objects in Fortress - why? Date: Thu, 6 Mar 2003 16:10:01 +0100 From: "Olaf Bergner" <[EMAIL PROTECTED]> To: "Avalon framework users" <[EMAIL PROTECTED]> Hi Peter, Peter Donald wrote: > On Wed, 5 Mar 2003 00:50, Olaf Bergner wrote: > > to create an instance of the component wrapper. A preliminary > > inspection of > > > the javadocs seems to indicate that this might work even in jdk1.2. > > > > Anyways, if you want to see it, you can have it. Just give me a note. > > I would like to see it integrated (or at least an option) in > fortress/ecm. SO > send along some diffs. > > -- > Cheers, > > Peter Donald Attached you will find three diffs, one unified, one context, one standard, as created by Eclipse, all rolled up into one single zip. I have never made any diffs before, so I chose to use all three different formats Eclipse has to offer. Hopefully, one of 'em will do the job. The diffs are to be applied against the org.apache.avalon.fortress.impl.handler package. Some notes: 1) In order to implement dispose() of org.apache.excalibur.mpool.ObjectFactory there's got to be a way of asking the generated wrapper class for the wrapped class. I have been reluctant to implement the equivalent of Object getWrappedObject() since this would offer clients a way of bypassing the wrapper class' purpose. Anyways, if you should find the code useful I would offer to add such a method. 2) No effort was made to make WrapperObjectFactory threadsafe. I am no expert in concurrent programming, and I am not sure if an implementation of ObjectFactory is supposed to operate in a multithreaded environment. 3) The HandlersTestCase will fail, since none of the work interfaces Role1, Role2, ... implements the method getID() this test case calls. This works for the ProxyObjectFactory due to its usage of the PassThroughInvocationHandler. Add those methods and the test case passes. IMHO, this constitutes a minor bug, er ... shortcoming in the test suite but you will have to decide for yourself. 4) I added 5 classes: WrapperObjectFactory, WrapperGenerator, BCELWrapperGenerator, BCELCodeGenerator and ProxyUtility. The latter factors out some methods from ProxyHelper which I decided to leave untouched, so this is a severe case of code duplication ;). 5) In order to see the new code at work you will have to replace new ProxyObjectFactory(...) in AbstractContainer.createObjectFactory(...) with new WrapperObjectFactory(...), but whom do I tell this ... Please let me know if you should have any issues with the code that might need attention. I will try to fix it as soon as I find some spare time (I am in the final months of my diploma in mathematics, so right now I am more concerned with group theory, topology, ... than with BCEL byte code manglers ;)). Oh, yes, regarding the code: You may tweak, rewrite, refactor it, port it to VB ..., er, no, wait! Don't do that! If you want to have it, it's yours. Cheers, Olaf Bergner ------------------------------------------------------- -- Cheers, Peter Donald *--------------------------------* | Every rule has an exception, | | except the rule of exceptions. | *--------------------------------*
bcel-wrapper.zip
Description: Zip compressed data
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
