I thin we must try "standard" Proxy first, BCEL must be the last possible solution, This code is very dangerous and error phone.
> Juozas, > > Thanks for your continued thinking on this dude. > > >Hi, > >ProxyGeneratorImpl and ClientClassAltrmiFactory use diferent ClassLoaders . > >We need to call "generate" in ClientClassAltrmiFactory not in ants task. > >I see BCEL is not very useful for ARMI if we are going to support only > >interfaces. > > > <skip/> > > I don't think that java.lang.reflect.Proxy is good enough for us. Why? > 1) A scripting env like the excellent BeanShell cannot query the exposed > methods and invoke them. It must work, because java.lang.reflect.Proxy generates byte code for interface implementation, and they are visible for reflection, Enhancer in simplestore implemented in the same way, but has more features. This problem is becouse diferent ClassLoades are used. > 2) As we are not delegating immediately to a ral impl, we cannot have a > single catch/throws block that suits all scenarios. I am sure it is possible to implement. If ARMI is not going to support Class types BCEL and java.lang.reflect.Proxy will do the same. Trust me I tested both. > > If it were not for that it would be a good solution. > > BCEL almost certainly is (one of) the right tools to dynamic make > proxies, the problem is it is Brain-Surgery to use. Anyone that can > actually use it to make a proxy of the type we find easy via our javac > route would be a god. > > I dream of a bytecode generator that allows me some natural java-like > construction : Yes, I thinking about this. It is trivial to implement, but it eats a lot of time for testing. > JMethod ap = new JMethod("actionPerformed"); > ap.addArg("event", ActionEvent.class); > ap.setVoidReturn(); // maybe this a default. > > InstructionList il = ap.getInstructionList(); > Var txtVar = new NewVar(String,"txt"); > ir.add(new JInstruction(txtVar, "event","toString")); > ir.add(new JInstruction(System.out, "println", txtVar)); > ap.generate(); > > Regards, > > - Paul > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>