geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bavo De Ridder <bderid...@novell.com>
Subject Re: Dynamic proxies
Date Thu, 07 Aug 2003 14:24:37 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Don't forget the classloading issues you can have with dynamic proxies. 
Interface and implementing class (target) have to be in the same classloader.

This currently gives me serious headaches with JBoss. Oh yes, please make a 
better classloading architecture compared to JBoss!


B.

On Thursday 07 August 2003 16:17, Alex Blewitt wrote:
> Dynamic Proxies in Java allowed developers to say:
>
> "Give me a new class that implements interface X so that all method
> calls are actually routed through to this piece of code"
>
> Essentially, a Dynamic Proxy allows you to have:
>
> public interface Thing {
>    public void doMethod();
>    public void doAntoherMethod();
> }
>
> and your code
>
> public class Processor implements InvocationHandler {
>    public void invoke(Object target, Method method, Object args) {
>      // do anything
>    }
> }
>
> and then say
>
> Thing t = Proxy.getProxyClass(Thing.class, new Processor());
>
> so that t.doMethod() and t.doAnotherMethod() both end up with your
> Processor method.
>
> See
> http://java.sun.com/j2se/1.4.1/docs/api/java/lang/reflect/Proxy.html
> for more info.
>
> Unfortunately, the ProxyClass is a bit knackered in that it only works
> with interfaces, not with all abstract types (i.e. abstract classes as
> well). Had it been designed to deal with all abstract types (like the
> inner classes do) then it'd have been much nicer.
>
> PS There are syntax errors above; this is from memory.
>
> On Thursday, Aug 7, 2003, at 15:09 Europe/London, Justin Ju wrote:
> > What do you mean about dynamic proxies?
> > Is it one of  the design patterns?
> > ----- Original Message -----
> > From: "Lyytinen Joonas" <joonas.lyytinen@cons.sonera.com>
> > To: <>
> > Sent: Thursday, August 07, 2003 7:43 PM
> > Subject: RE: how about maven?
> >
> >
> > Hi everyone,
> >
> > I'm new to the list and don't know how much general discussion around
> > this has allready been had, but before starting the implementation of
> > the EJB container a good deal of though probably should be given to the
> > implementation architecture of the EJB container.
> >
> > AFAIK currently there are three approaches to the EJB problem domain
> >
> > 1. Managing the EJB's using reflection
> > 2. Managing the EJB's through dynamic proxies
> > 3. Managing the EJB's using JMX
> >
> > Of these, the last one is newest and thus has the least references.
> > There is a good
> > academic study on the first two approaches
> > (http://www.cs.rice.edu/CS/Systems/DynaServer/> perf_scalability_ejb.pdf)
> > which states that there is no major performance  differences between
> > the two.
> >
> >
> > Has anyone any experiences with the JMX approach and data of it's
> > performance?
> > Maybe it would be beneficial to build small POC's of each before
> > starting the proper
> > implementation?
> >
> >> how about MX4J code, I see the code is
> >> under  License: Apache Software License
> >> that a good thing :-)

- -- 
2003-01-07 07:49:34 DEBUG [org.geek.Bootstrap] Init
2003-01-07 07:49:35 DEBUG [org.geek.Bootstrap] Life support systems
2003-01-07 07:49:36 FATAL [org.geek.Bootstrap] no caffeine detected
2003-01-07 07:49:37 FATAL [org.geek.Bootstrap] halting system
System Halted
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/MmElp1F1uut6FtQRAo7HAJ4yKeIZdwO1im4ouir8xaKzmcDtLACePmYd
tsNMb1GEjeH+vezd+QkCALw=
=xdls
-----END PGP SIGNATURE-----


Mime
View raw message