[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamic Proxy Classes



Hi Ozonies,

There is a new Dynamic proxy class API in JDK1.3
that could be interesting for generating Ozone Proxies
on the fly.

Here is the Sun's doc url:

http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html

To quote the doc:

"A new API for dynamic proxy classes has been added to the Java 2 Platform.
A dynamic proxy class is a class that implements a list of interfaces
specified at runtime such that a method invocation through one of the
interfaces on an instance of the class will be encoded and dispatched to
another object through a uniform interface. Thus, a dynamic proxy class can
be used to create a type-safe proxy object for a list of interfaces without
requiring pre-generation of the proxy class, such as with compile time
tools. Dynamic proxy classes are useful to applications that need to provide
type-safe reflective dispatch of invocations to objects that present
interface APIs. For example, an application can use a dynamic proxy class to
create an object that implements multiple arbitrary event listener
interfaces -- interfaces that extend java.util.EventListener -- to process a
variety of events of different types in a uniform fashion, such as by
logging all such events to a file. "

If the idea seems doable and interesting may be we could
provide both way to generate Proxy (OPP and this waty)
at least until everyone has switched to JDK1.3

Does this makes any sense?

Regards,

Johann